public final class ZstdEncoder extends MessageToByteEncoder<ByteBuf>
ChannelHandler.Sharable| Constructor and Description |
|---|
ZstdEncoder()
Creates a new Zstd encoder.
|
ZstdEncoder(int compressionLevel)
Creates a new Zstd encoder.
|
ZstdEncoder(int blockSize,
int maxEncodeSize)
Creates a new Zstd encoder.
|
ZstdEncoder(int compressionLevel,
int blockSize,
int maxEncodeSize) |
| Modifier and Type | Method and Description |
|---|---|
protected ByteBuf |
allocateBuffer(ChannelHandlerContext ctx,
ByteBuf msg,
boolean preferDirect)
Allocate a
ByteBuf which will be used as argument of #encode(ChannelHandlerContext, I, ByteBuf). |
protected void |
encode(ChannelHandlerContext ctx,
ByteBuf in,
ByteBuf out)
Encode a message into a
ByteBuf. |
void |
flush(ChannelHandlerContext ctx)
Calls
ChannelHandlerContext.flush() to forward
to the next ChannelOutboundHandler in the ChannelPipeline. |
void |
handlerAdded(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.
|
void |
handlerRemoved(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.
|
acceptOutboundMessage, isPreferDirect, writebind, close, connect, deregister, disconnect, readensureNotSharable, exceptionCaught, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaughtpublic ZstdEncoder()
ZstdEncoder(int,int) constructorpublic ZstdEncoder(int compressionLevel)
compressionLevel - specifies the level of the compressionpublic ZstdEncoder(int blockSize,
int maxEncodeSize)
blockSize - is used to calculate the compressionLevelmaxEncodeSize - specifies the size of the largest compressed objectpublic ZstdEncoder(int compressionLevel,
int blockSize,
int maxEncodeSize)
blockSize - is used to calculate the compressionLevelmaxEncodeSize - specifies the size of the largest compressed objectcompressionLevel - specifies the level of the compressionprotected ByteBuf allocateBuffer(ChannelHandlerContext ctx, ByteBuf msg, boolean preferDirect)
MessageToByteEncoderByteBuf which will be used as argument of #encode(ChannelHandlerContext, I, ByteBuf).
Sub-classes may override this method to return ByteBuf with a perfect matching initialCapacity.allocateBuffer in class MessageToByteEncoder<ByteBuf>protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out)
MessageToByteEncoderByteBuf. This method will be called for each written message that can be handled
by this encoder.encode in class MessageToByteEncoder<ByteBuf>ctx - the ChannelHandlerContext which this MessageToByteEncoder belongs toin - the message to encodeout - the ByteBuf into which the encoded message will be writtenpublic void flush(ChannelHandlerContext ctx)
ChannelOutboundHandlerAdapterChannelHandlerContext.flush() to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.flush in interface ChannelOutboundHandlerflush in class ChannelOutboundHandlerAdapterctx - the ChannelHandlerContext for which the flush operation is madepublic void handlerAdded(ChannelHandlerContext ctx)
ChannelHandlerAdapterhandlerAdded in interface ChannelHandlerhandlerAdded in class ChannelHandlerAdapterpublic void handlerRemoved(ChannelHandlerContext ctx) throws Exception
ChannelHandlerAdapterhandlerRemoved in interface ChannelHandlerhandlerRemoved in class ChannelHandlerAdapterExceptionCopyright © 2008–2025 The Netty Project. All rights reserved.