Class HpackHuffmanDecoder

    • Field Detail

      • HUFFMAN_COMPLETE_SHIFT

        private static final int HUFFMAN_COMPLETE_SHIFT
        See Also:
        Constant Field Values
      • HUFFMAN_EMIT_SYMBOL_SHIFT

        private static final int HUFFMAN_EMIT_SYMBOL_SHIFT
        See Also:
        Constant Field Values
      • HUFFS

        private static final int[] HUFFS
        A table of byte tuples (state, flags, output). They are packed together as: state<<16 + flags<<8 + output
      • dest

        private byte[] dest
      • k

        private int k
      • state

        private int state
    • Constructor Detail

      • HpackHuffmanDecoder

        HpackHuffmanDecoder()
    • Method Detail

      • decode

        public AsciiString decode​(ByteBuf buf,
                                  int length)
                           throws Http2Exception
        Decompresses the given Huffman coded string literal.
        Parameters:
        buf - the string literal to be decoded
        Returns:
        the output stream for the compressed data
        Throws:
        Http2Exception - EOS Decoded
      • process

        public boolean process​(byte input)
        This should never be called from anything but this class itself!
        Specified by:
        process in interface ByteProcessor
        Returns:
        true if the processor wants to continue the loop and handle the next byte in the buffer. false if the processor wants to stop handling bytes and abort the loop.
      • processNibble

        private boolean processNibble​(int input)