HttpMessage and an HttpContent in gzip or
deflate encoding while respecting the "Accept-Encoding" header.
If there is no matching encoding, no compression is done. For more
information on how this handler modifies the message, please refer to
HttpContentEncoder.
| Modifier and Type | Class and Description |
|---|---|
| private class | HttpContentCompressor.
Compression Encoder Factory that creates |
| private class | HttpContentCompressor.
Compression Encoder Factory that creates |
| private class | HttpContentCompressor.
Compression Encoder Factory that creates |
| private static class | HttpContentCompressor.
Compression Encoder Factory for create |
| private class | HttpContentCompressor.
Compression Encoder Factory for create |
| Modifier and Type | Field and Description |
|---|---|
| private final BrotliOptions | |
| private final int | |
| private final int | |
| private ChannelHandlerContext | |
| private final DeflateOptions | |
| private final Map | |
| private final GzipOptions | |
| private final int | |
| private final SnappyOptions | |
| private final boolean | |
| private final int | |
| private final ZstdOptions |
| Access | Constructor and Description |
|---|---|
| public | HttpContentCompressor()
Creates a new handler with the default compression level (6), default window size (15) and default memory level (8). |
| public | HttpContentCompressor(int
1 yields the fastest compression and 9 yields the
best compression. 0 means no compression. The default
compression level is 6.
Deprecated
Creates a new handler with the specified compression level, default
window size (15) and default memory level (8).
|
| public | HttpContentCompressor(int
1 yields the fastest compression and 9 yields the
best compression. 0 means no compression. The default
compression level is 6.The base two logarithm of the size of the history buffer. The
value should be in the range windowBits, int 9 to 15 inclusive.
Larger values result in better compression at the expense of
memory usage. The default value is 15.How much memory should be allocated for the internal compression
state. memLevel)1 uses minimum memory and 9 uses maximum
memory. Larger values result in better and faster compression
at the expense of memory usage. The default value is 8
Deprecated
Creates a new handler with the specified compression level, window size,
and memory level..
|
| public | HttpContentCompressor(int
1 yields the fastest compression and 9 yields the
best compression. 0 means no compression. The default
compression level is 6.The base two logarithm of the size of the history buffer. The
value should be in the range windowBits, int 9 to 15 inclusive.
Larger values result in better compression at the expense of
memory usage. The default value is 15.How much memory should be allocated for the internal compression
state. memLevel, int 1 uses minimum memory and 9 uses maximum
memory. Larger values result in better and faster compression
at the expense of memory usage. The default value is 8The response body is compressed when the size of the response
body exceeds the threshold. The value should be a non negative
number. contentSizeThreshold)0 will enable compression for all responses.
Deprecated
Creates a new handler with the specified compression level, window size,
and memory level..
|
| public | HttpContentCompressor(CompressionOptions...
CompressionOptions or null if the default
should be used.Create a new |
| public | HttpContentCompressor(int
The response body is compressed when the size of the response
body exceeds the threshold. The value should be a non negative
number. contentSizeThreshold, CompressionOptions... 0 will enable compression for all responses.CompressionOptions or null
if the default should be used.Create a new |
| Modifier and Type | Method and Description |
|---|---|
| protected HttpContentEncoder. | beginEncode(HttpResponse
the http response httpResponse, String the value of the acceptEncoding)"Accept-Encoding" headerImplements abstract io. |
| protected String | |
| protected ZlibWrapper | |
| public void | handlerAdded(ChannelHandlerContext ctx)
Overrides io. Implements io. ChannelHandler was added to the actual context and it's ready to handle events.
|
| brotliOptions | back to summary |
|---|---|
| private final BrotliOptions brotliOptions | |
| compressionLevel | back to summary |
|---|---|
| private final int compressionLevel | |
| contentSizeThreshold | back to summary |
|---|---|
| private final int contentSizeThreshold | |
| ctx | back to summary |
|---|---|
| private ChannelHandlerContext ctx | |
| deflateOptions | back to summary |
|---|---|
| private final DeflateOptions deflateOptions | |
| factories | back to summary |
|---|---|
| private final Map<String, CompressionEncoderFactory> factories | |
| gzipOptions | back to summary |
|---|---|
| private final GzipOptions gzipOptions | |
| memLevel | back to summary |
|---|---|
| private final int memLevel | |
| snappyOptions | back to summary |
|---|---|
| private final SnappyOptions snappyOptions | |
| supportsCompressionOptions | back to summary |
|---|---|
| private final boolean supportsCompressionOptions | |
| windowBits | back to summary |
|---|---|
| private final int windowBits | |
| zstdOptions | back to summary |
|---|---|
| private final ZstdOptions zstdOptions | |
| HttpContentCompressor | back to summary |
|---|---|
| public HttpContentCompressor() Creates a new handler with the default compression level (6), default window size (15) and default memory level (8). | |
| HttpContentCompressor | back to summary |
|---|---|
| public HttpContentCompressor(int compressionLevel)
Deprecated
Creates a new handler with the specified compression level, default window size (15) and default memory level (8).
| |
| HttpContentCompressor | back to summary |
|---|---|
| public HttpContentCompressor(int compressionLevel, int windowBits, int memLevel)
Deprecated
Creates a new handler with the specified compression level, window size, and memory level..
| |
| HttpContentCompressor | back to summary |
|---|---|
| public HttpContentCompressor(int compressionLevel, int windowBits, int memLevel, int contentSizeThreshold)
Deprecated
Creates a new handler with the specified compression level, window size, and memory level..
| |
| HttpContentCompressor | back to summary |
|---|---|
| public HttpContentCompressor(CompressionOptions... compressionOptions) Create a new
| |
| HttpContentCompressor | back to summary |
|---|---|
| public HttpContentCompressor(int contentSizeThreshold, CompressionOptions... compressionOptions) Create a new
| |
| beginEncode | back to summary |
|---|---|
| protected HttpContentEncoder. Implements abstract io. Doc from io. Prepare to encode the HTTP message content.
| |
| determineEncoding | back to summary |
|---|---|
protected String determineEncoding(String acceptEncoding)
| |
| determineWrapper | back to summary |
|---|---|
| protected ZlibWrapper determineWrapper(String acceptEncoding)
Deprecated
| |
| handlerAdded | back to summary |
|---|---|
| public void handlerAdded(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Gets called after the
| |
BrotliEncoders
used to compress http content for br content encoding
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public MessageToByteEncoder |
| BrEncoderFactory | back to summary |
|---|---|
| private BrEncoderFactory() | |
| createEncoder | back to summary |
|---|---|
| public MessageToByteEncoder Implements io.
| |
ZlibEncoders
used to compress http content for deflate content encoding
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public MessageToByteEncoder |
| DeflateEncoderFactory | back to summary |
|---|---|
| private DeflateEncoderFactory() | |
| createEncoder | back to summary |
|---|---|
| public MessageToByteEncoder Implements io.
| |
ZlibEncoders
used to compress http content for gzip content encoding
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public MessageToByteEncoder |
| GzipEncoderFactory | back to summary |
|---|---|
| private GzipEncoderFactory() | |
| createEncoder | back to summary |
|---|---|
| public MessageToByteEncoder Implements io.
| |
SnappyFrameEncoder
used to compress http content for snappy content encoding
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public MessageToByteEncoder |
| SnappyEncoderFactory | back to summary |
|---|---|
| private SnappyEncoderFactory() | |
| createEncoder | back to summary |
|---|---|
| public MessageToByteEncoder Implements io.
| |
ZstdEncoder
used to compress http content for zstd content encoding
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public MessageToByteEncoder |
| ZstdEncoderFactory | back to summary |
|---|---|
| private ZstdEncoderFactory() | |
| createEncoder | back to summary |
|---|---|
| public MessageToByteEncoder Implements io.
| |