Package io.netty.handler.codec.http2
Class HpackHuffmanEncoder
java.lang.Object
io.netty.handler.codec.http2.HpackHuffmanEncoder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final class
private final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]
private final HpackHuffmanEncoder.EncodedLengthProcessor
private final HpackHuffmanEncoder.EncodeProcessor
private final byte[]
-
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
private
HpackHuffmanEncoder
(int[] codes, byte[] lengths) Creates a new Huffman encoder with the specified Huffman coding. -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(ByteBuf out, CharSequence data) Compresses the input string literal using the Huffman coding.private void
encodeSlowPath
(ByteBuf out, CharSequence data) (package private) int
getEncodedLength
(CharSequence data) Returns the number of bytes required to Huffman encode the input string literal.private int
-
Field Details
-
codes
private final int[] codes -
lengths
private final byte[] lengths -
encodedLengthProcessor
-
encodeProcessor
-
-
Constructor Details
-
HpackHuffmanEncoder
HpackHuffmanEncoder() -
HpackHuffmanEncoder
private HpackHuffmanEncoder(int[] codes, byte[] lengths) Creates a new Huffman encoder with the specified Huffman coding.- Parameters:
codes
- the Huffman codes indexed by symbollengths
- the length of each Huffman code
-
-
Method Details
-
encode
Compresses the input string literal using the Huffman coding.- Parameters:
out
- the output stream for the compressed datadata
- the string literal to be Huffman encoded
-
encodeSlowPath
-
getEncodedLength
Returns the number of bytes required to Huffman encode the input string literal.- Parameters:
data
- the string literal to be Huffman encoded- Returns:
- the number of bytes required to Huffman encode
data
-
getEncodedLengthSlowPath
-