Class BZip2CompressorInputStream

java.lang.Object
java.io.InputStream
org.apache.commons.compress.compressors.CompressorInputStream
org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream
All Implemented Interfaces:
Closeable, AutoCloseable, InputStreamStatistics

An input stream that decompresses from the BZip2 format to be read as any other stream.
This class is not thread-safe
  • Field Details

  • Constructor Details

    • BZip2CompressorInputStream

      Constructs a new BZip2CompressorInputStream which decompresses bytes read from the specified stream. This doesn't support decompressing concatenated .bz2 files.
      Parameters:
      in - the InputStream from which this object should be created
      Throws:
      IOException - if the stream content is malformed or an I/O error occurs.
      NullPointerException - if in == null
    • BZip2CompressorInputStream

      public BZip2CompressorInputStream(InputStream in, boolean decompressConcatenated) throws IOException
      Constructs a new BZip2CompressorInputStream which decompresses bytes read from the specified stream.
      Parameters:
      in - the InputStream from which this object should be created
      decompressConcatenated - if true, decompress until the end of the input; if false, stop after the first .bz2 stream and leave the input position to point to the next byte after the .bz2 stream
      Throws:
      IOException - if in == null, the stream content is malformed, or an I/O error occurs.
  • Method Details