public final class HuffmanDecoder
extends java.lang.Object
| Constructor and Description |
|---|
HuffmanDecoder(int maxBits,
int maxSymbols)
Construct
HuffmanDecoder. |
| Modifier and Type | Method and Description |
|---|---|
int |
decodeSymbol(java.nio.channels.ReadableByteChannel src,
BitDecoder bitDecoder,
int bufferIndex)
Decode next symbol.
|
void |
setCodeLengths(byte[] codeLengths)
Set code lengths.
|
public HuffmanDecoder(int maxBits,
int maxSymbols)
HuffmanDecoder.maxBits - Maximum length of a symbol.maxSymbols - Maximum number of symbols.public void setCodeLengths(byte[] codeLengths)
throws java.io.IOException
codeLengths - The code lengths to set.java.io.IOException - if inconsistent data is encountered.public int decodeSymbol(java.nio.channels.ReadableByteChannel src,
BitDecoder bitDecoder,
int bufferIndex)
throws java.io.IOException
src - The channel to read the symbol from.bitDecoder - The BitDecoder to use for bit decoding.bufferIndex - The bit buffer to use for bit decoding.java.io.IOException - If an I/O error occurred.