Class HuffmanDecoder
java.lang.Object
org.apache.hc.core5.http2.hpack.HuffmanDecoder
This Huffman codec implementation has been derived from Twitter HPack project
(https://github.com/twitter/hpack)
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final boolean[]private static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate final int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean[]buildEndStates(List<HuffmanDecoder.Node> nodes, int eosCode, int eosLength) private static int[]buildTransitions(List<HuffmanDecoder.Node> nodes) private static List<HuffmanDecoder.Node> buildTree(int[] codes, byte[] lengths) (package private) voiddecode(ByteArrayBuffer out, ByteBuffer src) private static booleanisLeaf(int value) private static intleaf(int symbol) private static intsymbol(int leaf)
-
Field Details
-
BYTE_VALUES
private static final int BYTE_VALUES- See Also:
-
MISSING
private static final int MISSING- See Also:
-
STATE_BITS
private static final int STATE_BITS- See Also:
-
STATE_MASK
private static final int STATE_MASK- See Also:
-
FIRST_SYMBOL_SHIFT
private static final int FIRST_SYMBOL_SHIFT- See Also:
-
SECOND_SYMBOL_SHIFT
private static final int SECOND_SYMBOL_SHIFT- See Also:
-
SYMBOL_COUNT_SHIFT
private static final int SYMBOL_COUNT_SHIFT- See Also:
-
SYMBOL_COUNT_MASK
private static final int SYMBOL_COUNT_MASK- See Also:
-
INVALID_FLAG
private static final int INVALID_FLAG- See Also:
-
EOS_FLAG
private static final int EOS_FLAG- See Also:
-
ERROR_MASK
private static final int ERROR_MASK- See Also:
-
transitions
private final int[] transitions -
endStates
private final boolean[] endStates
-
-
Constructor Details
-
HuffmanDecoder
HuffmanDecoder(int[] codes, byte[] lengths)
-
-
Method Details
-
decode
- Throws:
HPackException
-
buildTree
-
buildTransitions
-
buildEndStates
private static boolean[] buildEndStates(List<HuffmanDecoder.Node> nodes, int eosCode, int eosLength) -
leaf
private static int leaf(int symbol) -
isLeaf
private static boolean isLeaf(int value) -
symbol
private static int symbol(int leaf)
-