Class HpackHuffmanEncoder


  • final class HpackHuffmanEncoder
    extends java.lang.Object
    • 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 symbol
        lengths - 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 data
        data - 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)