Class HpackHuffmanDecoder

java.lang.Object
io.netty.handler.codec.http2.HpackHuffmanDecoder
All Implemented Interfaces:
ByteProcessor

final class HpackHuffmanDecoder extends Object implements ByteProcessor
  • Field Details

    • HUFFMAN_COMPLETE

      private static final byte HUFFMAN_COMPLETE
      See Also:
    • HUFFMAN_EMIT_SYMBOL

      private static final byte HUFFMAN_EMIT_SYMBOL
      See Also:
    • HUFFMAN_FAIL

      private static final byte HUFFMAN_FAIL
      See Also:
    • HUFFMAN_COMPLETE_SHIFT

      private static final int HUFFMAN_COMPLETE_SHIFT
      See Also:
    • HUFFMAN_EMIT_SYMBOL_SHIFT

      private static final int HUFFMAN_EMIT_SYMBOL_SHIFT
      See Also:
    • HUFFMAN_FAIL_SHIFT

      private static final int HUFFMAN_FAIL_SHIFT
      See Also:
    • HUFFS

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

      stateinvalid input: '<'invalid input: '<'16 + flagsinvalid input: '<'invalid input: '<'8 + output

    • BAD_ENCODING

      private static final Http2Exception BAD_ENCODING
    • dest

      private byte[] dest
    • k

      private int k
    • state

      private int state
  • Constructor Details

    • HpackHuffmanDecoder

      HpackHuffmanDecoder()
  • Method Details

    • 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)