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, BZip2Constants, InputStreamStatistics

public class BZip2CompressorInputStream extends CompressorInputStream implements BZip2Constants, InputStreamStatistics
An input stream that decompresses from the BZip2 format to be read as any other stream.
  • Field Details

    • last

      private int last
      Index of the last char in the block, so the block size == last + 1.
    • origPtr

      private int origPtr
      Index in zptr[] of original string after sorting.
    • blockSize100k

      private int blockSize100k
      always: in the range 0 .. 9. The current block size is 100000 * this number.
    • blockRandomised

      private boolean blockRandomised
    • crc

      private final CRC crc
    • nInUse

      private int nInUse
    • bin

      private BitInputStream bin
    • decompressConcatenated

      private final boolean decompressConcatenated
    • EOF

      private static final int EOF
      See Also:
    • START_BLOCK_STATE

      private static final int START_BLOCK_STATE
      See Also:
    • RAND_PART_A_STATE

      private static final int RAND_PART_A_STATE
      See Also:
    • RAND_PART_B_STATE

      private static final int RAND_PART_B_STATE
      See Also:
    • RAND_PART_C_STATE

      private static final int RAND_PART_C_STATE
      See Also:
    • NO_RAND_PART_A_STATE

      private static final int NO_RAND_PART_A_STATE
      See Also:
    • NO_RAND_PART_B_STATE

      private static final int NO_RAND_PART_B_STATE
      See Also:
    • NO_RAND_PART_C_STATE

      private static final int NO_RAND_PART_C_STATE
      See Also:
    • currentState

      private int currentState
    • storedBlockCRC

      private int storedBlockCRC
    • storedCombinedCRC

      private int storedCombinedCRC
    • computedBlockCRC

      private int computedBlockCRC
    • computedCombinedCRC

      private int computedCombinedCRC
    • su_count

      private int su_count
    • su_ch2

      private int su_ch2
    • su_chPrev

      private int su_chPrev
    • su_i2

      private int su_i2
    • su_j2

      private int su_j2
    • su_rNToGo

      private int su_rNToGo
    • su_rTPos

      private int su_rTPos
    • su_tPos

      private int su_tPos
    • su_z

      private char su_z
    • data

      All memory intensive stuff. This field is initialized by initBlock().
  • Constructor Details

    • BZip2CompressorInputStream

      public BZip2CompressorInputStream(InputStream in) throws IOException
      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