Package net.sf.jazzlib
Class InflaterHuffmanTree
- java.lang.Object
-
- net.sf.jazzlib.InflaterHuffmanTree
-
public class InflaterHuffmanTree extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static InflaterHuffmanTreedefDistTreestatic InflaterHuffmanTreedefLitLenTreeprivate static intMAX_BITLENprivate short[]tree
-
Constructor Summary
Constructors Constructor Description InflaterHuffmanTree(byte[] codeLengths)Constructs a Huffman tree from the array of code lengths.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidbuildTree(byte[] codeLengths)intgetSymbol(StreamManipulator input)Reads the next symbol from input.
-
-
-
Field Detail
-
MAX_BITLEN
private static final int MAX_BITLEN
- See Also:
- Constant Field Values
-
tree
private short[] tree
-
defLitLenTree
public static InflaterHuffmanTree defLitLenTree
-
defDistTree
public static InflaterHuffmanTree defDistTree
-
-
Constructor Detail
-
InflaterHuffmanTree
public InflaterHuffmanTree(byte[] codeLengths) throws DataFormatExceptionConstructs a Huffman tree from the array of code lengths.- Parameters:
codeLengths- the array of code lengths- Throws:
DataFormatException
-
-
Method Detail
-
buildTree
private void buildTree(byte[] codeLengths) throws DataFormatException- Throws:
DataFormatException
-
getSymbol
public int getSymbol(StreamManipulator input) throws DataFormatException
Reads the next symbol from input. The symbol is encoded using the huffman tree.- Parameters:
input- the input source.- Returns:
- the next symbol, or -1 if not enough input is available.
- Throws:
DataFormatException
-
-