Class QpackDecoder

  • All Implemented Interfaces:

    public class QpackDecoder
    extends java.lang.Object
    implements Dumpable
    • Constructor Detail

      • QpackDecoder

        public QpackDecoder​(Instruction.Handler handler,
                            int maxHeaderSize)
        maxHeaderSize - The maximum allowed size of a headers block, expressed as total of all name and value characters, plus 32 per field
    • Method Detail

      • getMaxHeaderSize

        public int getMaxHeaderSize()
      • setMaxHeaderSize

        public void setMaxHeaderSize​(int maxHeaderSize)
      • getMaxBlockedStreams

        public int getMaxBlockedStreams()
      • setMaxBlockedStreams

        public void setMaxBlockedStreams​(int maxBlockedStreams)
      • decode

        public boolean decode​(long streamId,
                              java.nio.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​(java.nio.ByteBuffer buffer)
                               throws QpackException
        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 - 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​(java.lang.Appendable out,
                         java.lang.String indent)
        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.
        Throws: - if unable to write to Appendable
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object