The decompression requires large amounts of memory. Thus you
should call the close()
method as soon as
possible, to force CBZip2InputStream
to release the
allocated memory. See CBZip2OutputStream
for information about memory usage.
CBZip2InputStream
reads bytes from the compressed
source stream via the single byte read()
method exclusively. Thus you should consider to use a
buffered source stream.
Instances of this class are not threadsafe.
Modifier and Type | Class and Description |
---|---|
private static class |
Modifier and Type | Field and Description |
---|---|
private boolean | |
private int | blockSize100k
always: in the range 0 .. |
private int | |
private int | |
private int | |
private int | |
private final CRC | |
private int | |
private int | |
private CBZip2InputStream. | data
All memory intensive stuff. |
private final boolean | |
private static final int | |
private InputStream | |
private int | last
Index of the last char in the block, so the block size == last + 1. |
private int | |
private static final int | |
private static final int | |
private static final int | |
private int | origPtr
Index in zptr[] of original string after sorting. |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private int | |
private int | |
private int | |
private int | |
private int | |
private int | |
private int | |
private int | |
private int | |
private int | |
private char |
Access | Constructor and Description |
---|---|
public | CBZip2InputStream(final InputStream
InputStream in)Constructs a new CBZip2InputStream which decompresses bytes read from the specified stream. |
public | CBZip2InputStream(final InputStream
the InputStream from which this object should be created in, final boolean 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 decompressConcatenated)Constructs a new CBZip2InputStream which decompresses bytes read from the specified stream. |
Modifier and Type | Method and Description |
---|---|
private boolean | |
private int | |
private char | |
private int | |
public void | close()
Overrides java. Implements java. |
private boolean | |
private void | createHuffmanDecodingTables(final int alphaSize, final int nGroups)
Called by recvDecodingTables() exclusively. |
private void | |
private void | |
private int | |
private static void | hbCreateDecodeTables(final int[] limit, final int[] base, final int[] perm, final char[] length, final int minLen, final int maxLen, final int alphaSize)
Called by createHuffmanDecodingTables() exclusively. |
private boolean | |
private void | |
private void | |
public int | read()
Implements abstract java. |
public int | read(final byte[]
the buffer into which the data is read. dest, final int the start offset in array offs, final int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. len bytes of data from the input stream into
an array of bytes.
|
private int | |
private void | |
private static void | |
private void | |
private void | |
private void | |
private void | |
private void | |
private void | |
private void |
blockRandomised | back to summary |
---|---|
private boolean blockRandomised |
blockSize100k | back to summary |
---|---|
private int blockSize100k always: in the range 0 .. 9. The current block size is 100000 * this number. |
bsBuff | back to summary |
---|---|
private int bsBuff |
bsLive | back to summary |
---|---|
private int bsLive |
computedBlockCRC | back to summary |
---|---|
private int computedBlockCRC |
computedCombinedCRC | back to summary |
---|---|
private int computedCombinedCRC |
crc | back to summary |
---|---|
private final CRC crc |
currentChar | back to summary |
---|---|
private int currentChar |
currentState | back to summary |
---|---|
private int currentState |
data | back to summary |
---|---|
private CBZip2InputStream. All memory intensive stuff. This field is initialized by initBlock(). |
decompressConcatenated | back to summary |
---|---|
private final boolean decompressConcatenated |
EOF | back to summary |
---|---|
private static final int EOF |
in | back to summary |
---|---|
private InputStream in |
last | back to summary |
---|---|
private int last Index of the last char in the block, so the block size == last + 1. |
nInUse | back to summary |
---|---|
private int nInUse |
NO_RAND_PART_A_STATE | back to summary |
---|---|
private static final int NO_RAND_PART_A_STATE |
NO_RAND_PART_B_STATE | back to summary |
---|---|
private static final int NO_RAND_PART_B_STATE |
NO_RAND_PART_C_STATE | back to summary |
---|---|
private static final int NO_RAND_PART_C_STATE |
origPtr | back to summary |
---|---|
private int origPtr Index in zptr[] of original string after sorting. |
RAND_PART_A_STATE | back to summary |
---|---|
private static final int RAND_PART_A_STATE |
RAND_PART_B_STATE | back to summary |
---|---|
private static final int RAND_PART_B_STATE |
RAND_PART_C_STATE | back to summary |
---|---|
private static final int RAND_PART_C_STATE |
START_BLOCK_STATE | back to summary |
---|---|
private static final int START_BLOCK_STATE |
storedBlockCRC | back to summary |
---|---|
private int storedBlockCRC |
storedCombinedCRC | back to summary |
---|---|
private int storedCombinedCRC |
su_ch2 | back to summary |
---|---|
private int su_ch2 |
su_chPrev | back to summary |
---|---|
private int su_chPrev |
su_count | back to summary |
---|---|
private int su_count |
su_i2 | back to summary |
---|---|
private int su_i2 |
su_j2 | back to summary |
---|---|
private int su_j2 |
su_rNToGo | back to summary |
---|---|
private int su_rNToGo |
su_rTPos | back to summary |
---|---|
private int su_rTPos |
su_tPos | back to summary |
---|---|
private int su_tPos |
su_z | back to summary |
---|---|
private char su_z |
CBZip2InputStream | back to summary |
---|---|
public CBZip2InputStream(final InputStream in) throws IOException Constructs a new CBZip2InputStream which decompresses bytes read from the specified stream. This doesn't support decompressing concatenated .bz2 files. Although BZip2 headers are marked with the magic
|
CBZip2InputStream | back to summary |
---|---|
public CBZip2InputStream(final InputStream in, final boolean decompressConcatenated) throws IOException Constructs a new CBZip2InputStream which decompresses bytes read from the specified stream. Although BZip2 headers are marked with the magic
|
bsGetBit | back to summary |
---|---|
private boolean bsGetBit() throws IOException |
bsGetInt | back to summary |
---|---|
private int bsGetInt() throws IOException |
bsGetUByte | back to summary |
---|---|
private char bsGetUByte() throws IOException |
bsR | back to summary |
---|---|
private int bsR(final int n) throws IOException |
close | back to summary |
---|---|
public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream.
|
complete | back to summary |
---|---|
private boolean complete() throws IOException |
createHuffmanDecodingTables | back to summary |
---|---|
private void createHuffmanDecodingTables(final int alphaSize, final int nGroups) Called by recvDecodingTables() exclusively. |
endBlock | back to summary |
---|---|
private void endBlock() |
getAndMoveToFrontDecode | back to summary |
---|---|
private void getAndMoveToFrontDecode() throws IOException |
getAndMoveToFrontDecode0 | back to summary |
---|---|
private int getAndMoveToFrontDecode0(final int groupNo) throws IOException |
hbCreateDecodeTables | back to summary |
---|---|
private static void hbCreateDecodeTables(final int[] limit, final int[] base, final int[] perm, final char[] length, final int minLen, final int maxLen, final int alphaSize) Called by createHuffmanDecodingTables() exclusively. |
init | back to summary |
---|---|
private boolean init(boolean isFirstStream) throws IOException |
initBlock | back to summary |
---|---|
private void initBlock() throws IOException |
makeMaps | back to summary |
---|---|
private void makeMaps() |
read | back to summary |
---|---|
public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
|
read | back to summary |
---|---|
public int read(final byte[] dest, final int offs, final int len) throws IOException Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
|
read0 | back to summary |
---|---|
private int read0() throws IOException |
recvDecodingTables | back to summary |
---|---|
private void recvDecodingTables() throws IOException |
reportCRCError | back to summary |
---|---|
private static void reportCRCError() |
setupBlock | back to summary |
---|---|
private void setupBlock() throws IOException |
setupNoRandPartA | back to summary |
---|---|
private void setupNoRandPartA() throws IOException |
setupNoRandPartB | back to summary |
---|---|
private void setupNoRandPartB() throws IOException |
setupNoRandPartC | back to summary |
---|---|
private void setupNoRandPartC() throws IOException |
setupRandPartA | back to summary |
---|---|
private void setupRandPartA() throws IOException |
setupRandPartB | back to summary |
---|---|
private void setupRandPartB() throws IOException |
setupRandPartC | back to summary |
---|---|
private void setupRandPartC() throws IOException |
Modifier and Type | Field and Description |
---|---|
pack-priv final int[][] | |
pack-priv final int[] | |
pack-priv final char[] | |
pack-priv final boolean[] | |
pack-priv final int[][] | |
pack-priv byte[] | |
pack-priv final int[] | |
pack-priv final int[][] | |
pack-priv final byte[] | |
pack-priv final byte[] | |
pack-priv final byte[] | |
pack-priv final byte[] | |
pack-priv final char[][] | |
pack-priv int[] | |
pack-priv final int[] | unzftab
Freq table collected to save a pass over the data during decompression. |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
pack-priv final int[] |
base | back to summary |
---|---|
pack-priv final int[][] base |
cftab | back to summary |
---|---|
pack-priv final int[] cftab |
getAndMoveToFrontDecode_yy | back to summary |
---|---|
pack-priv final char[] getAndMoveToFrontDecode_yy |
inUse | back to summary |
---|---|
pack-priv final boolean[] inUse |
limit | back to summary |
---|---|
pack-priv final int[][] limit |
ll8 | back to summary |
---|---|
pack-priv byte[] ll8 |
minLens | back to summary |
---|---|
pack-priv final int[] minLens |
perm | back to summary |
---|---|
pack-priv final int[][] perm |
recvDecodingTables_pos | back to summary |
---|---|
pack-priv final byte[] recvDecodingTables_pos |
selector | back to summary |
---|---|
pack-priv final byte[] selector |
selectorMtf | back to summary |
---|---|
pack-priv final byte[] selectorMtf |
seqToUnseq | back to summary |
---|---|
pack-priv final byte[] seqToUnseq |
temp_charArray2d | back to summary |
---|---|
pack-priv final char[][] temp_charArray2d |
tt | back to summary |
---|---|
pack-priv int[] tt |
unzftab | back to summary |
---|---|
pack-priv final int[] unzftab Freq table collected to save a pass over the data during decompression. |
Data | back to summary |
---|---|
pack-priv Data(int blockSize100k) |
initTT | back to summary |
---|---|
pack-priv final int[] initTT(int length) Initializes the |