Class QpackDecoder

All Implemented Interfaces:

public class QpackDecoder extends Object implements Dumpable
  • Constructor Details

  • Method Details

    • getMaxHeadersSize

      public int getMaxHeadersSize()
    • setMaxHeadersSize

      public void setMaxHeadersSize(int maxHeadersSize)
      maxHeadersSize - The maximum allowed size of a headers block, expressed as total of all name and value characters, plus 32 per field
    • getMaxBlockedStreams

      public int getMaxBlockedStreams()
    • setMaxBlockedStreams

      public void setMaxBlockedStreams(int maxBlockedStreams)
    • getMaxTableCapacity

      public int getMaxTableCapacity()
    • setMaxTableCapacity

      public void setMaxTableCapacity(int maxTableCapacity)
    • decode

      public boolean decode(long streamId, ByteBuffer buffer, QpackDecoder.Handler handler) throws QpackException

      Decode a buffer into a MetaData object given a HTTP/3 stream ID. The buffer must be the complete content of a headers frame and will be fully consumed. It may be that the Dynamic Table does not yet contain the state required to decode this headers frame, in this case the encoded headers will be saved until the required state arrives on the instruction stream to update the dynamic table.

      This method may generate instructions to be sent back over the Decoder stream to the remote Encoder.

      streamId - the stream ID corresponding to this headers frame.
      buffer - the content of the headers frame.
      handler - a handler that is invoked when the MetaData is able to be decoded.
      true if the MetaData could be decoded immediately without requiring addition state in the DynamicTable.
      QpackException - if there was an error with the QPACK decompression.
    • parseInstructions

      public void parseInstructions(ByteBuffer buffer) throws QpackException.SessionException
      Parse instructions from the Encoder stream. The Encoder stream carries an unframed sequence of instructions from the Encoder to the Decoder. This method will fully consume the supplied ByteBuffer and produce instructions to update the state of the Decoder and its Dynamic Table.
      buffer - a buffer containing bytes from the Encoder stream.
      QpackException.SessionException - if there was an error parsing or handling the instructions.
    • streamCancellation

      public void streamCancellation(long streamId)
      Tells the QpackDecoder that a particular stream has been cancelled. Any encoded field sections for this stream will be discarded and a stream cancellation instruction will be sent to the remote Encoder.
      streamId - the streamId of the stream that was cancelled.
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Description copied from interface: Dumpable
      Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
      Specified by:
      dump in interface Dumpable
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      IOException - if unable to write to Appendable
    • toString

      public String toString()
      toString in class Object