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 int | |
| public static final int | |
| public static final int | |
| public static final int | |
| private DeflateOptions | |
| private GzipOptions | |
| private int | |
| private final Http2Connection. | |
| private SnappyOptions | |
| private final boolean | |
| private int | |
| private ZstdOptions |
| Access | Constructor and Description |
|---|---|
| public | CompressorHttp2ConnectionEncoder(Http2ConnectionEncoder delegate)
Create a new |
| public | CompressorHttp2ConnectionEncoder(Http2ConnectionEncoder delegate, int compressionLevel, int windowBits, int memLevel)
Deprecated
Create a new CompressorHttp2ConnectionEncoder instance
|
| public | CompressorHttp2ConnectionEncoder(Http2ConnectionEncoder delegate, CompressionOptions... compressionOptionsArgs)
Create a new |
| Modifier and Type | Method and Description |
|---|---|
| private void | bindCompressorToStream(EmbeddedChannel
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, EmbeddedChannel 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 EmbeddedChannel | newCompressionChannel(final ChannelHandlerContext
the context. ctx, ZlibWrapper Defines what type of encoder should be used wrapper)Generate a new instance of an |
| private EmbeddedChannel | 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 EmbeddedChannel | Returns: a newByteToMessageDecoder if the specified encoding is supported. null otherwise
(alternatively, you can throw a Http2Exception to block unknown encoding).the context. ctx, CharSequence the value of the contentEncoding)content-encoding headerReturns a new |
| private static ByteBuf | nextReadableBuf(EmbeddedChannel
The channel to read from compressor)Read the next compressed |
| public ChannelFuture | writeData(final ChannelHandlerContext
the context to use for writing. ctx, final int the stream for which to send the frame. streamId, ByteBuf 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, ChannelPromise the promise for the write. promise)Overrides io. Implements io. DATA frame to the remote endpoint.
|
| public ChannelFuture | 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, ChannelPromise the promise for the write. promise)Overrides io. Implements io. |
| public ChannelFuture | 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, final ChannelPromise the promise for the write. promise)Overrides io. Implements io. |
| brotliOptions | back to summary |
|---|---|
| private BrotliOptions brotliOptions | |
| compressionLevel | back to summary |
|---|---|
| private int compressionLevel | |
| DEFAULT_COMPRESSION_LEVEL | back to summary |
|---|---|
| public static final int DEFAULT_COMPRESSION_LEVEL | |
| DEFAULT_MEM_LEVEL | back to summary |
|---|---|
| public static final int DEFAULT_MEM_LEVEL | |
| DEFAULT_WINDOW_BITS | back to summary |
|---|---|
| public static final int DEFAULT_WINDOW_BITS | |
| deflateOptions | back to summary |
|---|---|
| private DeflateOptions deflateOptions | |
| gzipCompressionOptions | back to summary |
|---|---|
| private GzipOptions gzipCompressionOptions | |
| memLevel | back to summary |
|---|---|
| private int memLevel | |
| propertyKey | back to summary |
|---|---|
| private final Http2Connection. | |
| snappyOptions | back to summary |
|---|---|
| private SnappyOptions snappyOptions | |
| supportsCompressionOptions | back to summary |
|---|---|
| private final boolean supportsCompressionOptions | |
| windowBits | back to summary |
|---|---|
| private int windowBits | |
| 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, int compressionLevel, int windowBits, int memLevel)
Deprecated
Create a new
| |
| CompressorHttp2ConnectionEncoder | back to summary |
|---|---|
| public CompressorHttp2ConnectionEncoder(Http2ConnectionEncoder delegate, CompressionOptions... compressionOptionsArgs) Create a new | |
| bindCompressorToStream | back to summary |
|---|---|
| private void bindCompressorToStream(EmbeddedChannel 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, EmbeddedChannel 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 EmbeddedChannel newCompressionChannel(final ChannelHandlerContext ctx, ZlibWrapper wrapper) Generate a new instance of an
| |
| newCompressor | back to summary |
|---|---|
| private EmbeddedChannel 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 EmbeddedChannel newContentCompressor(ChannelHandlerContext ctx, CharSequence contentEncoding) throws Http2Exception Returns a new
| |
| nextReadableBuf | back to summary |
|---|---|
| private static ByteBuf nextReadableBuf(EmbeddedChannel compressor) Read the next compressed
| |
| writeData | back to summary |
|---|---|
| public ChannelFuture writeData(final ChannelHandlerContext ctx, final int streamId, ByteBuf data, int padding, final boolean endOfStream, ChannelPromise promise) Overrides io. Implements io. Doc from io. Writes a
| |
| writeHeaders | back to summary |
|---|---|
| public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream, ChannelPromise promise) Overrides io. Implements io. Doc from io. Writes a HEADERS frame to the remote endpoint.
| |
| writeHeaders | back to summary |
|---|---|
| public ChannelFuture writeHeaders(final ChannelHandlerContext ctx, final int streamId, final Http2Headers headers, final int streamDependency, final short weight, final boolean exclusive, final int padding, final boolean endOfStream, final ChannelPromise promise) Overrides io. Implements io. Doc from io. Writes a HEADERS frame with priority specified to the remote endpoint.
| |