ByteBuf using the deflate algorithm.
| Modifier and Type | Field and Description |
|---|---|
| private final CRC32 | |
| private volatile ChannelHandlerContext | |
| private final Deflater | |
| private volatile boolean | |
| private static final byte[] | |
| private static final InternalLogger | |
| private static final int | MAX_INITIAL_OUTPUT_BUFFER_SIZE
Maximum initial size for temporary heap buffers used for the compressed output. |
| private static final int | MAX_INPUT_BUFFER_SIZE
Max size for temporary heap buffers used to copy input data to heap. |
| private final ZlibWrapper | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | JdkZlibEncoder()
Creates a new zlib encoder with the default compression level ( |
| public | JdkZlibEncoder(int
1 yields the fastest compression and 9 yields the
best compression. 0 means no compression. The default
compression level is 6.Creates a new zlib encoder with the specified |
| public | JdkZlibEncoder(ZlibWrapper wrapper)
Creates a new zlib encoder with the default compression level ( |
| public | JdkZlibEncoder(ZlibWrapper wrapper, int
1 yields the fastest compression and 9 yields the
best compression. 0 means no compression. The default
compression level is 6.Creates a new zlib encoder with the specified |
| public | JdkZlibEncoder(byte[]
the preset dictionary dictionary)Creates a new zlib encoder with the default compression level ( |
| public | JdkZlibEncoder(int
1 yields the fastest compression and 9 yields the
best compression. 0 means no compression. The default
compression level is 6.the preset dictionary dictionary)Creates a new zlib encoder with the specified |
| Modifier and Type | Method and Description |
|---|---|
| protected final ByteBuf | allocateBuffer(ChannelHandlerContext ctx, ByteBuf msg, boolean preferDirect)
Overrides io. ByteBuf which will be used as argument of encode(ChannelHandlerContext, I, ByteBuf).
|
| public ChannelFuture | close()
Implements abstract io. ZlibEncoder and so finish the encoding.
|
| public ChannelFuture | close(final ChannelPromise promise)
Implements abstract io. ZlibEncoder and so finish the encoding.
|
| public void | close(final ChannelHandlerContext
the ctx, final ChannelPromise ChannelHandlerContext for which the close operation is madethe promise)ChannelPromise to notify once the operation completesOverrides io. Implements io. ChannelHandlerContext#close(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
|
| private ChannelHandlerContext | |
| private void | |
| private void | |
| protected void | encode(ChannelHandlerContext
the ctx, ByteBuf ChannelHandlerContext which this MessageToByteEncoder belongs tothe message to encode uncompressed, ByteBuf the out)ByteBuf into which the encoded message will be writtenImplements abstract io. ByteBuf.
|
| private void | |
| private ChannelFuture | |
| public void | handlerAdded(ChannelHandlerContext ctx)
Overrides io. Implements io. ChannelHandler was added to the actual context and it's ready to handle events.
|
| public boolean | isClosed()
Implements abstract io. true if and only if the end of the compressed stream
has been reached.
|
| crc | back to summary |
|---|---|
| private final CRC32 crc | |
| ctx | back to summary |
|---|---|
| private volatile ChannelHandlerContext ctx | |
| deflater | back to summary |
|---|---|
| private final Deflater deflater | |
| finished | back to summary |
|---|---|
| private volatile boolean finished | |
| gzipHeader | back to summary |
|---|---|
| private static final byte[] gzipHeader | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger | |
| MAX_INITIAL_OUTPUT_BUFFER_SIZE | back to summary |
|---|---|
| private static final int MAX_INITIAL_OUTPUT_BUFFER_SIZE Maximum initial size for temporary heap buffers used for the compressed output. Buffer may still grow beyond this if necessary. | |
| MAX_INPUT_BUFFER_SIZE | back to summary |
|---|---|
| private static final int MAX_INPUT_BUFFER_SIZE Max size for temporary heap buffers used to copy input data to heap. | |
| wrapper | back to summary |
|---|---|
| private final ZlibWrapper wrapper | |
| writeHeader | back to summary |
|---|---|
| private boolean writeHeader | |
| JdkZlibEncoder | back to summary |
|---|---|
| public JdkZlibEncoder() Creates a new zlib encoder with the default compression level (
| |
| JdkZlibEncoder | back to summary |
|---|---|
| public JdkZlibEncoder(int compressionLevel) Creates a new zlib encoder with the specified
| |
| JdkZlibEncoder | back to summary |
|---|---|
| public JdkZlibEncoder(ZlibWrapper wrapper) Creates a new zlib encoder with the default compression level (
| |
| JdkZlibEncoder | back to summary |
|---|---|
| public JdkZlibEncoder(ZlibWrapper wrapper, int compressionLevel) Creates a new zlib encoder with the specified
| |
| JdkZlibEncoder | back to summary |
|---|---|
| public JdkZlibEncoder(byte[] dictionary) Creates a new zlib encoder with the default compression level (
| |
| JdkZlibEncoder | back to summary |
|---|---|
| public JdkZlibEncoder(int compressionLevel, byte[] dictionary) Creates a new zlib encoder with the specified
| |
| allocateBuffer | back to summary |
|---|---|
| protected final ByteBuf allocateBuffer(ChannelHandlerContext ctx, ByteBuf msg, boolean preferDirect) throws Exception Overrides io. Doc from io. Allocate a
| |
| close | back to summary |
|---|---|
| public ChannelFuture close() Implements abstract io. Doc from io. Close this
| |
| close | back to summary |
|---|---|
| public ChannelFuture close(final ChannelPromise promise) Implements abstract io. Doc from io. Close this
| |
| close | back to summary |
|---|---|
| public void close(final ChannelHandlerContext ctx, final ChannelPromise promise) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| ctx | back to summary |
|---|---|
| private ChannelHandlerContext ctx() | |
| deflate | back to summary |
|---|---|
private void deflate(ByteBuf out)
| |
| deflateJdk6 | back to summary |
|---|---|
| private void deflateJdk6(ByteBuf out) | |
| encode | back to summary |
|---|---|
| protected void encode(ChannelHandlerContext ctx, ByteBuf uncompressed, ByteBuf out) throws Exception Implements abstract io. Doc from io. Encode a message into a
| |
| encodeSome | back to summary |
|---|---|
| private void encodeSome(ByteBuf in, ByteBuf out) | |
| finishEncode | back to summary |
|---|---|
| private ChannelFuture finishEncode(final ChannelHandlerContext ctx, ChannelPromise promise) | |
| handlerAdded | back to summary |
|---|---|
| public void handlerAdded(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Gets called after the
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Implements abstract io. Doc from io. Returns
| |