Package org.eclipse.jetty.http3.qpack
Class QpackEncoder
java.lang.Object
org.eclipse.jetty.http3.qpack.QpackEncoder
- All Implemented Interfaces:
Dumpable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EnumSet<HttpHeader>
static final EnumSet<HttpHeader>
static final EnumSet<HttpHeader>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dump
(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.void
encode
(ByteBuffer buffer, long streamId, MetaData metadata) Encodes aMetaData
object into the suppliedByteBuffer
for a specific HTTP/s stream.int
int
int
int
boolean
A speculative insert of a Header into the Encoders Dynamic Table.void
parseInstructions
(ByteBuffer buffer) Parse instructions from the Decoder stream.void
setMaxBlockedStreams
(int maxBlockedStreams) void
setMaxHeadersSize
(int maxHeadersSize) void
setMaxTableCapacity
(int maxTableCapacity) void
setTableCapacity
(int capacity) Set the capacity of the DynamicTable and send an instruction to set the capacity on the remote Decoder.protected boolean
shouldHuffmanEncode
(HttpField httpField) protected boolean
shouldIndex
(HttpField httpField) void
streamCancellation
(long streamId) Tells theQpackEncoder
that 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
MetaData
object into the suppliedByteBuffer
for a specific HTTP/s stream.This method may generate instructions to be sent back over the Encoder stream to the remote Decoder.
The given
buffer
is filled starting from its current positionp
with 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
- theMetaData
to 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 suppliedByteBuffer
and 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 theQpackEncoder
that 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: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 interfaceDumpable
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-