content-encoding header for each
stream. The compression provided by this class will be applied to the data for the entire stream.
| Modifier and Type | Field and Description |
|---|---|
| private BrotliOptions | |
| private DeflateOptions | |
| private GzipOptions | |
| private final Http2Connection. | |
| private final boolean | |
| private ZstdOptions |
| Access | Constructor and Description |
|---|---|
| public | CompressorHttp2ConnectionEncoder(Http2ConnectionEncoder delegate)
Create a new |
| public | CompressorHttp2ConnectionEncoder(Http2ConnectionEncoder delegate, CompressionOptions... compressionOptionsArgs)
Create a new |
| Modifier and Type | Method and Description |
|---|---|
| private void | bindCompressorToStream(Compressor
The compressor associated with the stream identified by compressor, int streamId.The stream id for which the headers were written. streamId)Called after the super class has written the headers and created any associated stream objects. |
| pack-priv void | cleanup(Http2Stream
The stream for which stream, Compressor compressor is the compressor forThe compressor for compressor)streamRelease remaining content from |
| private static CompressionOptions[] | |
| protected CharSequence | Returns: the expected content encoding of the new content.the value of the contentEncoding)content-encoding headerReturns the expected content encoding of the decoded content. |
| private Compressor | newCompressionChannel(final ChannelHandlerContext
the context. ctx, ZlibWrapper Defines what type of encoder should be used wrapper)Generate a new instance of an |
| private Compressor | Returns: The channel used to compress data.the context. ctx, Http2Headers Object representing headers which are to be written headers, boolean Indicates if the stream has ended endOfStream)Checks if a new compressor object is needed for the stream identified by |
| protected Compressor | Returns: a newByteToMessageDecoder if the specified encoding is supported.
Otherwise null.
Alternatively, you can throw a Http2Exception to block unknown encoding.the context. ctx, CharSequence the value of the contentEncoding)content-encoding headerReturns a new |
| public Future | writeData(final ChannelHandlerContext
the context to use for writing. ctx, final int the stream for which to send the frame. streamId, Buffer the payload of the frame. This will be released by this method. data, int additional bytes that should be added to obscure the true content size. Must be between 0 and
256 (inclusive). A 1 byte padding is encoded as just the pad length field with value 0.
A 256 byte padding is encoded as the pad length field with value 255 and 255 padding bytes
appended to the end of the frame. padding, final boolean indicates if this is the last frame to be sent for the stream. endOfStream)Overrides io. Implements io. DATA frame to the remote endpoint.
|
| public Future | writeHeaders(ChannelHandlerContext
the context to use for writing. ctx, int the stream for which to send the frame. streamId, Http2Headers the headers to be sent. headers, int additional bytes that should be added to obscure the true content size. Must be between 0 and
256 (inclusive). padding, boolean indicates if this is the last frame to be sent for the stream. endStream)Overrides io. Implements io. |
| public Future | writeHeaders(final ChannelHandlerContext
the context to use for writing. ctx, final int the stream for which to send the frame. streamId, final Http2Headers the headers to be sent. headers, final int the stream on which this stream should depend, or 0 if it should
depend on the connection. streamDependency, final short the weight for this stream. weight, final boolean whether this stream should be the exclusive dependant of its parent. exclusive, final int additional bytes that should be added to obscure the true content size. Must be between 0 and
256 (inclusive). padding, final boolean indicates if this is the last frame to be sent for the stream. endOfStream)Overrides io. Implements io. |
| brotliOptions | back to summary |
|---|---|
| private BrotliOptions brotliOptions | |
| deflateOptions | back to summary |
|---|---|
| private DeflateOptions deflateOptions | |
| gzipCompressionOptions | back to summary |
|---|---|
| private GzipOptions gzipCompressionOptions | |
| propertyKey | back to summary |
|---|---|
| private final Http2Connection. | |
| supportsCompressionOptions | back to summary |
|---|---|
| private final boolean supportsCompressionOptions | |
| zstdOptions | back to summary |
|---|---|
| private ZstdOptions zstdOptions | |
| CompressorHttp2ConnectionEncoder | back to summary |
|---|---|
| public CompressorHttp2ConnectionEncoder(Http2ConnectionEncoder delegate) Create a new | |
| CompressorHttp2ConnectionEncoder | back to summary |
|---|---|
| public CompressorHttp2ConnectionEncoder(Http2ConnectionEncoder delegate, CompressionOptions... compressionOptionsArgs) Create a new | |
| bindCompressorToStream | back to summary |
|---|---|
| private void bindCompressorToStream(Compressor compressor, int streamId) Called after the super class has written the headers and created any associated stream objects.
| |
| cleanup | back to summary |
|---|---|
| pack-priv void cleanup(Http2Stream stream, Compressor compressor) Release remaining content from
| |
| defaultCompressionOptions | back to summary |
|---|---|
| private static CompressionOptions[] defaultCompressionOptions() | |
| getTargetContentEncoding | back to summary |
|---|---|
| protected CharSequence getTargetContentEncoding(CharSequence contentEncoding) throws Http2Exception Returns the expected content encoding of the decoded content. Returning
| |
| newCompressionChannel | back to summary |
|---|---|
| private Compressor newCompressionChannel(final ChannelHandlerContext ctx, ZlibWrapper wrapper) Generate a new instance of an
| |
| newCompressor | back to summary |
|---|---|
| private Compressor newCompressor(ChannelHandlerContext ctx, Http2Headers headers, boolean endOfStream) throws Http2Exception Checks if a new compressor object is needed for the stream identified by
| |
| newContentCompressor | back to summary |
|---|---|
| protected Compressor newContentCompressor(ChannelHandlerContext ctx, CharSequence contentEncoding) throws Http2Exception Returns a new
| |
| writeData | back to summary |
|---|---|
| public Future Overrides io. Implements io. Doc from io. Writes a
| |
| writeHeaders | back to summary |
|---|---|
| public Future Overrides io. Implements io. Doc from io. Writes a HEADERS frame to the remote endpoint.
| |
| writeHeaders | back to summary |
|---|---|
| public Future Overrides io. Implements io. Doc from io. Writes a HEADERS frame with priority specified to the remote endpoint.
| |