java.lang.Object
org.apache.pekko.http.shaded.com.twitter.hpack.Decoder

public final class Decoder extends Object
  • Constructor Details

    • Decoder

      public Decoder(int maxHeaderSize, int maxHeaderTableSize)
      Creates a new decoder.
  • Method Details

    • decode

      public void decode(InputStream in, HeaderListener headerListener) throws IOException
      Decode the header block into header fields.

      in must hold the complete header block. The decoder reads forward until the stream ends and reports a block that stops in the middle of a representation as a decompression failure, so the stream needs to support neither mark/reset nor an available() that covers the whole remaining block.

      Throws:
      IOException
    • endHeaderBlock

      public boolean endHeaderBlock()
      End the current header block. Returns if the header field has been truncated. This must be called after the header block has been completely decoded.
    • setMaxHeaderTableSize

      public void setMaxHeaderTableSize(int maxHeaderTableSize)
      Set the maximum table size. If this is below the maximum size of the dynamic table used by the encoder, the beginning of the next header block MUST signal this change.
    • getMaxHeaderTableSize

      public int getMaxHeaderTableSize()
      Return the maximum table size. This is the maximum size allowed by both the encoder and the decoder.