Class Bzip2HuffmanStageDecoder
- java.lang.Object
-
- io.netty.handler.codec.compression.Bzip2HuffmanStageDecoder
-
final class Bzip2HuffmanStageDecoder extends java.lang.ObjectA decoder for the Bzip2 Huffman coding stage.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intalphabetSizeThe total number of codes (uniform for each table).private int[][]codeBasesAn array of values for each Huffman table that must be subtracted from the numerical value of a Huffman code of a given bit length to give its canonical code index.private int[][]codeLimitsAn array of values for each Huffman table that gives the highest numerical value of a Huffman code of a given bit length.private int[][]codeSymbolsA mapping for each Huffman table from canonical code index to output symbol.(package private) intcurrentAlpha(package private) intcurrentGroup(package private) intcurrentLength(package private) intcurrentSelectorprivate intcurrentTableThe Huffman table for the current group.private intgroupIndexThe index of the current group within the selectors array.private intgroupPositionThe byte position within the current group.private int[]minimumLengthsThe minimum code length for each Huffman table.(package private) booleanmodifyLengthprivate Bzip2BitReaderreaderA reader that provides bit-level reads.(package private) byte[]selectorsThe Huffman table number to use for each group of 50 symbols.(package private) byte[][]tableCodeLengthsThe Canonical Huffman code lengths for each table.(package private) Bzip2MoveToFrontTabletableMTFTable for Move To Front transformations.(package private) inttotalTablesTotal number of used Huffman tables in range 2..6.
-
Constructor Summary
Constructors Constructor Description Bzip2HuffmanStageDecoder(Bzip2BitReader reader, int totalTables, int alphabetSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcreateHuffmanDecodingTables()Constructs Huffman decoding tables from lists of Canonical Huffman code lengths.(package private) intnextSymbol()Decodes and returns the next symbol.
-
-
-
Field Detail
-
reader
private final Bzip2BitReader reader
A reader that provides bit-level reads.
-
selectors
byte[] selectors
The Huffman table number to use for each group of 50 symbols.
-
minimumLengths
private final int[] minimumLengths
The minimum code length for each Huffman table.
-
codeBases
private final int[][] codeBases
An array of values for each Huffman table that must be subtracted from the numerical value of a Huffman code of a given bit length to give its canonical code index.
-
codeLimits
private final int[][] codeLimits
An array of values for each Huffman table that gives the highest numerical value of a Huffman code of a given bit length.
-
codeSymbols
private final int[][] codeSymbols
A mapping for each Huffman table from canonical code index to output symbol.
-
currentTable
private int currentTable
The Huffman table for the current group.
-
groupIndex
private int groupIndex
The index of the current group within the selectors array.
-
groupPosition
private int groupPosition
The byte position within the current group. A new group is selected every 50 decoded bytes.
-
totalTables
final int totalTables
Total number of used Huffman tables in range 2..6.
-
alphabetSize
final int alphabetSize
The total number of codes (uniform for each table).
-
tableMTF
final Bzip2MoveToFrontTable tableMTF
Table for Move To Front transformations.
-
currentSelector
int currentSelector
-
tableCodeLengths
final byte[][] tableCodeLengths
The Canonical Huffman code lengths for each table.
-
currentGroup
int currentGroup
-
currentLength
int currentLength
-
currentAlpha
int currentAlpha
-
modifyLength
boolean modifyLength
-
-
Constructor Detail
-
Bzip2HuffmanStageDecoder
Bzip2HuffmanStageDecoder(Bzip2BitReader reader, int totalTables, int alphabetSize)
-
-