Class QpackEncoder
java.lang.Object
org.eclipse.jetty.http3.qpack.QpackEncoder
- All Implemented Interfaces:
Dumpable
-
Nested Class Summary
Nested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EnumSet<HttpHeader> static final EnumSet<HttpHeader> static final EnumSet<HttpHeader> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.voidencode(ByteBuffer buffer, long streamId, MetaData metadata) Encodes aMetaDataobject into the suppliedByteBufferfor a specific HTTP/s stream.intintintintbooleanA speculative insert of a Header into the Encoders Dynamic Table.voidparseInstructions(ByteBuffer buffer) Parse instructions from the Decoder stream.voidsetMaxBlockedStreams(int maxBlockedStreams) voidsetMaxHeadersSize(int maxHeadersSize) voidsetMaxTableCapacity(int maxTableCapacity) voidsetTableCapacity(int capacity) Set the capacity of the DynamicTable and send an instruction to set the capacity on the remote Decoder.protected booleanshouldHuffmanEncode(HttpField httpField) protected booleanshouldIndex(HttpField httpField) voidstreamCancellation(long streamId) Tells theQpackEncoderthat a particular stream has been cancelled.
-
Field Details
-
DO_NOT_HUFFMAN
-
DO_NOT_INDEX
-
NEVER_INDEX
-
-
Constructor Details
-
QpackEncoder
-
-
Method Details
-
getMaxBlockedStreams
public int getMaxBlockedStreams() -
setMaxBlockedStreams
public void setMaxBlockedStreams(int maxBlockedStreams) -
getMaxHeadersSize
public int getMaxHeadersSize() -
setMaxHeadersSize
public void setMaxHeadersSize(int maxHeadersSize) -
getMaxTableCapacity
public int getMaxTableCapacity() -
setMaxTableCapacity
public void setMaxTableCapacity(int maxTableCapacity) -
getTableCapacity
public int getTableCapacity() -
setTableCapacity
public void setTableCapacity(int capacity) Set the capacity of the DynamicTable and send an instruction to set the capacity on the remote Decoder.- Parameters:
capacity- the new capacity.
-
encode
Encodes a
MetaDataobject into the suppliedByteBufferfor a specific HTTP/s stream.This method may generate instructions to be sent back over the Encoder stream to the remote Decoder.
The given
bufferis filled starting from its current positionpwith N encoded bytes and upon return its position will bep + N.- Parameters:
buffer- the buffer to take the bytes of the encodedMetaData.streamId- the stream ID corresponding to this headers frame.metadata- theMetaDatato encode into the buffer.- Throws:
QpackException- if there was an error with the QPACK compression.
-
parseInstructions
Parse instructions from the Decoder stream. The Decoder stream carries an unframed sequence of instructions from the Decoder to the Encoder. This method will fully consume the suppliedByteBufferand produce instructions to update the state of the Encoder and its Dynamic Table.- Parameters:
buffer- a buffer containing bytes from the Decoder stream.- Throws:
QpackException- if there was an error parsing or handling the instructions.
-
insert
A speculative insert of a Header into the Encoders Dynamic Table. This will also generate an instruction to be sent over the Encoder stream to the remote Decoder.- Parameters:
field- the field to insert into the Dynamic Table.- Returns:
- true if the field was successfully inserted into the Dynamic Table.
-
streamCancellation
public void streamCancellation(long streamId) Tells theQpackEncoderthat a particular stream has been cancelled. Any state stored for this stream will be discarded. The encoder may also receive a stream cancellation instruction from the remote Decoder to cancel the stream which will be a noop if this method was called on the local encoder first.- Parameters:
streamId- the streamId of the stream that was cancelled.
-
shouldIndex
-
shouldHuffmanEncode
-
dump
Description copied from interface:DumpableDump 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:
dumpin interfaceDumpable- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-