decodeHuffmanData(Bzip2HuffmanStageDecoder)decodeHuffmanData(Bzip2HuffmanStageDecoder)decodeHuffmanData(Bzip2HuffmanStageDecoder)initialiseInverseBWT()read()read() (through decodeNextBWTByte())
| Modifier and Type | Field and Description |
|---|---|
| private final int | blockCRC
The CRC of the current block as read from the block header. |
| private final boolean | blockRandomised
|
| private final byte[] | bwtBlock
The Burrows-Wheeler Transform processed data. |
| private int | bwtBlockLength
The actual length in bytes of the current block at the Inverse Burrows Wheeler Transform stage (before final Run-Length Decoding). |
| private final int[] | bwtByteCounts
Counts of each byte value within the |
| private int | bwtBytesDecoded
The number of output bytes that have been decoded up to the Inverse Burrows Wheeler Transform stage. |
| private int | bwtCurrentMergedPointer
The current merged pointer into the Burrow-Wheeler Transform array. |
| private int[] | bwtMergedPointers
At each position contains the union of :- An output character (8 bits) A pointer from each position to its successor (24 bits, left shifted 8 bits) As the pointer cannot exceed the maximum block size of 900k, 24 bits is more than enough to hold it; Folding the character data into the spare bits while performing the inverse BWT, when both pieces of information are available, saves a large number of memory accesses in the final decoding stages. |
| private final int | bwtStartPointer
Starting pointer into BWT for after untransform. |
| private final Crc32 | crc
Calculates the block CRC from the fully decoded bytes of the block. |
| pack-priv int | huffmanEndOfBlockSymbol
The end-of-block Huffman symbol. |
| pack-priv int | huffmanInUse16
Bitmap, of ranges of 16 bytes, present/not present. |
| pack-priv final byte[] | huffmanSymbolMap
A map from Huffman symbol index to output character. |
| private int | |
| private int | randomCount
If the current block is randomised, the remaining count at the current RNUMS position. |
| private int | randomIndex
If the current block is randomised, the position within the RNUMS randomisation array. |
| private final Bzip2BitReader | reader
A reader that provides bit-level reads. |
| private int | |
| private int | |
| private int | rleAccumulator
The number of previous identical output bytes decoded. |
| private int | rleLastDecodedByte
The most recently RLE decoded byte. |
| private int | rleRepeat
The RLE repeat count of the current decoded byte. |
| private final Bzip2MoveToFrontTable | symbolMTF
Table for Move To Front transformations. |
| Access | Constructor and Description |
|---|---|
| pack-priv | Bzip2BlockDecompressor(final int blockSize, final int blockCRC, final boolean blockRandomised, final int bwtStartPointer, final Bzip2BitReader reader)
|
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| pack-priv int | |
| pack-priv boolean | decodeHuffmanData(final Bzip2HuffmanStageDecoder huffmanDecoder)
Reads the Huffman encoded data from the input stream, performs Run-Length Decoding and applies the Move To Front transform to reconstruct the Burrows-Wheeler Transform array. |
| private int | Returns: The decoded byteDecodes a byte from the Burrows-Wheeler Transform stage. |
| private void | |
| public int | Returns: The decoded byte, or -1 if there are no more bytesDecodes a byte from the final Run-Length Encoding stage, pulling a new byte from the Burrows-Wheeler Transform stage when required. |
| blockCRC | back to summary |
|---|---|
| private final int blockCRC The CRC of the current block as read from the block header. | |
| blockRandomised | back to summary |
|---|---|
| private final boolean blockRandomised
| |
| bwtBlock | back to summary |
|---|---|
| private final byte[] bwtBlock The Burrows-Wheeler Transform processed data. Read at the Move To Front stage, consumed by the Inverse Burrows Wheeler Transform stage. | |
| bwtBlockLength | back to summary |
|---|---|
| private int bwtBlockLength The actual length in bytes of the current block at the Inverse Burrows Wheeler Transform stage (before final Run-Length Decoding). | |
| bwtByteCounts | back to summary |
|---|---|
| private final int[] bwtByteCounts Counts of each byte value within the | |
| bwtBytesDecoded | back to summary |
|---|---|
| private int bwtBytesDecoded The number of output bytes that have been decoded up to the Inverse Burrows Wheeler Transform stage. | |
| bwtCurrentMergedPointer | back to summary |
|---|---|
| private int bwtCurrentMergedPointer The current merged pointer into the Burrow-Wheeler Transform array. | |
| bwtMergedPointers | back to summary |
|---|---|
| private int[] bwtMergedPointers At each position contains the union of :- An output character (8 bits) A pointer from each position to its successor (24 bits, left shifted 8 bits) As the pointer cannot exceed the maximum block size of 900k, 24 bits is more than enough to hold it; Folding the character data into the spare bits while performing the inverse BWT, when both pieces of information are available, saves a large number of memory accesses in the final decoding stages. | |
| bwtStartPointer | back to summary |
|---|---|
| private final int bwtStartPointer Starting pointer into BWT for after untransform. | |
| crc | back to summary |
|---|---|
| private final Crc32 crc Calculates the block CRC from the fully decoded bytes of the block. | |
| huffmanEndOfBlockSymbol | back to summary |
|---|---|
| pack-priv int huffmanEndOfBlockSymbol The end-of-block Huffman symbol. Decoding of the block ends when this is encountered. | |
| huffmanInUse16 | back to summary |
|---|---|
| pack-priv int huffmanInUse16 Bitmap, of ranges of 16 bytes, present/not present. | |
| huffmanSymbolMap | back to summary |
|---|---|
| pack-priv final byte[] huffmanSymbolMap A map from Huffman symbol index to output character. Some types of data (e.g. ASCII text) may contain only a limited number of byte values; Huffman symbols are only allocated to those values that actually occur in the uncompressed data. | |
| mtfValue | back to summary |
|---|---|
| private int mtfValue | |
| randomCount | back to summary |
|---|---|
| private int randomCount If the current block is randomised, the remaining count at the current RNUMS position. | |
| randomIndex | back to summary |
|---|---|
| private int randomIndex If the current block is randomised, the position within the RNUMS randomisation array. | |
| reader | back to summary |
|---|---|
| private final Bzip2BitReader reader A reader that provides bit-level reads. | |
| repeatCount | back to summary |
|---|---|
| private int repeatCount | |
| repeatIncrement | back to summary |
|---|---|
| private int repeatIncrement | |
| rleAccumulator | back to summary |
|---|---|
| private int rleAccumulator The number of previous identical output bytes decoded. After 4 identical bytes, the next byte decoded is an RLE repeat count. | |
| rleLastDecodedByte | back to summary |
|---|---|
| private int rleLastDecodedByte The most recently RLE decoded byte. | |
| rleRepeat | back to summary |
|---|---|
| private int rleRepeat The RLE repeat count of the current decoded byte. When this reaches zero, a new byte is decoded. | |
| symbolMTF | back to summary |
|---|---|
| private final Bzip2MoveToFrontTable symbolMTF Table for Move To Front transformations. | |
| Bzip2BlockDecompressor | back to summary |
|---|---|
| pack-priv Bzip2BlockDecompressor(final int blockSize, final int blockCRC, final boolean blockRandomised, final int bwtStartPointer, final Bzip2BitReader reader) | |
| blockLength | back to summary |
|---|---|
| public int blockLength() | |
| checkCRC | back to summary |
|---|---|
| pack-priv int checkCRC() Verify and return the block CRC. This method may only be called after all of the block's bytes have been read.
| |
| decodeHuffmanData | back to summary |
|---|---|
| pack-priv boolean decodeHuffmanData(final Bzip2HuffmanStageDecoder huffmanDecoder) Reads the Huffman encoded data from the input stream, performs Run-Length Decoding and applies the Move To Front transform to reconstruct the Burrows-Wheeler Transform array. | |
| decodeNextBWTByte | back to summary |
|---|---|
| private int decodeNextBWTByte() Decodes a byte from the Burrows-Wheeler Transform stage. If the block has randomisation applied, reverses the randomisation.
| |
| initialiseInverseBWT | back to summary |
|---|---|
| private void initialiseInverseBWT() Set up the Inverse Burrows-Wheeler Transform merged pointer array. | |
| read | back to summary |
|---|---|
| public int read() Decodes a byte from the final Run-Length Encoding stage, pulling a new byte from the Burrows-Wheeler Transform stage when required.
| |