Top Description Fields Constructors Methods
org.bouncycastle.apache.bzip2

public Class CBZip2InputStream

extends InputStream
implements BZip2Constants
Class Inheritance
All Implemented Interfaces
org.bouncycastle.apache.bzip2.BZip2Constants
Imports
java.io.EOFException, .IOException, .InputStream, org.bouncycastle.util.Arrays, .Integers

An input stream that decompresses from the BZip2 format (with the file header chars) to be read as any other stream.
Author
Keiron Liddle NB: note this class has been modified to read the leading BZ from the start of the BZIP2 stream to make it compatible with other PGP programs.

Field Summary

Modifier and TypeField and Description
private int[][]
private final CRC
private int
private int
private int
private InputStream
pack-priv int
pack-priv int
pack-priv int
private int
private int
private int
private int
pack-priv int
i

pack-priv int
pack-priv int
private int
private int[][]
private byte[]
private int[]
private int
private static final int
private static final int
private int
private int[][]
private static final int
private static final int
pack-priv int
pack-priv int
private byte[]
private byte[]
private int
private boolean
pack-priv int
private int[]
private int[]
pack-priv int
z

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private void
private int
private int
bsGetBits(int n)

private int
private int
private long
private void
private void
private void
hbCreateDecodeTables(int[] limit, int[] base, int[] perm, byte[] length, int minLen, int maxLen, int alphaSize)

public int
read()

Implements abstract java.io.InputStream.read.

Reads the next byte of data from the input stream.
private int
private int
private void
private void
private void
private void
private void
private void
Inherited from java.io.InputStream:
availableclosemarkmarkSupportednullInputStreamreadreadreadAllBytesreadNBytesreadNBytesresetskipskipNBytestransferTo

Field Detail

baseback to summary
private int[][] base
blockCRCback to summary
private final CRC blockCRC
blockSize100kback to summary
private int blockSize100k
bsBuffback to summary
private int bsBuff
bsLiveback to summary
private int bsLive
bsStreamback to summary
private InputStream bsStream
ch2back to summary
pack-priv int ch2
chPrevback to summary
pack-priv int chPrev
countback to summary
pack-priv int count
currentByteback to summary
private int currentByte
currentStateback to summary
private int currentState
expectedBlockCRCback to summary
private int expectedBlockCRC
expectedStreamCRCback to summary
private int expectedStreamCRC
iback to summary
pack-priv int i
i2back to summary
pack-priv int i2
j2back to summary
pack-priv int j2
lastback to summary
private int last
limitback to summary
private int[][] limit
ll8back to summary
private byte[] ll8
minLensback to summary
private int[] minLens
nInUseback to summary
private int nInUse
NO_RAND_PART_B_STATEback to summary
private static final int NO_RAND_PART_B_STATE
NO_RAND_PART_C_STATEback to summary
private static final int NO_RAND_PART_C_STATE
origPtrback to summary
private int origPtr
permback to summary
private int[][] perm
RAND_PART_B_STATEback to summary
private static final int RAND_PART_B_STATE
RAND_PART_C_STATEback to summary
private static final int RAND_PART_C_STATE
rNToGoback to summary
pack-priv int rNToGo
rTPosback to summary
pack-priv int rTPos
selectorsback to summary
private byte[] selectors
seqToUnseqback to summary
private byte[] seqToUnseq
streamCRCback to summary
private int streamCRC
streamEndback to summary
private boolean streamEnd
tPosback to summary
pack-priv int tPos
ttback to summary
private int[] tt
unzftabback to summary
private int[] unzftab
zback to summary
pack-priv int z

Constructor Detail

CBZip2InputStreamback to summary
public CBZip2InputStream(InputStream zStream) throws IOException

Method Detail

beginBlockback to summary
private void beginBlock() throws IOException
bsFinishedWithStreamback to summary
private void bsFinishedWithStream()
bsGetBitback to summary
private int bsGetBit() throws IOException
bsGetBitsback to summary
private int bsGetBits(int n) throws IOException
bsGetBitsSmallback to summary
private int bsGetBitsSmall(int n) throws IOException
bsGetInt32back to summary
private int bsGetInt32() throws IOException
bsGetLong48back to summary
private long bsGetLong48() throws IOException
endBlockback to summary
private void endBlock() throws IOException
getAndMoveToFrontDecodeback to summary
private void getAndMoveToFrontDecode() throws IOException
hbCreateDecodeTablesback to summary
private void hbCreateDecodeTables(int[] limit, int[] base, int[] perm, byte[] length, int minLen, int maxLen, int alphaSize)
readback to summary
public int read() throws IOException

Implements abstract java.io.InputStream.read.

Doc from java.io.InputStream.read.

Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Returns:int

the next byte of data, or -1 if the end of the stream is reached.

Exceptions
IOException:
if an I/O error occurs.
recvDecodingTablesback to summary
private int recvDecodingTables() throws IOException
requireByteback to summary
private int requireByte() throws IOException
setupNoRandPartAback to summary
private void setupNoRandPartA() throws IOException
setupNoRandPartBback to summary
private void setupNoRandPartB() throws IOException
setupNoRandPartCback to summary
private void setupNoRandPartC() throws IOException
setupRandPartAback to summary
private void setupRandPartA() throws IOException
setupRandPartBback to summary
private void setupRandPartB() throws IOException
setupRandPartCback to summary
private void setupRandPartC() throws IOException