Package io.netty.handler.codec.http2
Class HpackHuffmanEncoder
- java.lang.Object
-
- io.netty.handler.codec.http2.HpackHuffmanEncoder
-
final class HpackHuffmanEncoder extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classHpackHuffmanEncoder.EncodedLengthProcessorprivate classHpackHuffmanEncoder.EncodeProcessor
-
Field Summary
Fields Modifier and Type Field Description private int[]codesprivate HpackHuffmanEncoder.EncodedLengthProcessorencodedLengthProcessorprivate HpackHuffmanEncoder.EncodeProcessorencodeProcessorprivate byte[]lengths
-
Constructor Summary
Constructors Modifier Constructor Description (package private)HpackHuffmanEncoder()privateHpackHuffmanEncoder(int[] codes, byte[] lengths)Creates a new Huffman encoder with the specified Huffman coding.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidencode(ByteBuf out, java.lang.CharSequence data)Compresses the input string literal using the Huffman coding.private voidencodeSlowPath(ByteBuf out, java.lang.CharSequence data)(package private) intgetEncodedLength(java.lang.CharSequence data)Returns the number of bytes required to Huffman encode the input string literal.private intgetEncodedLengthSlowPath(java.lang.CharSequence data)
-
-
-
Field Detail
-
codes
private final int[] codes
-
lengths
private final byte[] lengths
-
encodedLengthProcessor
private final HpackHuffmanEncoder.EncodedLengthProcessor encodedLengthProcessor
-
encodeProcessor
private final HpackHuffmanEncoder.EncodeProcessor encodeProcessor
-
-
Constructor Detail
-
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 Detail
-
encode
public void encode(ByteBuf out, java.lang.CharSequence data)
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
private void encodeSlowPath(ByteBuf out, java.lang.CharSequence data)
-
getEncodedLength
int getEncodedLength(java.lang.CharSequence data)
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
private int getEncodedLengthSlowPath(java.lang.CharSequence data)
-
-