public final class ZstdEncoder extends MessageToByteEncoder<ByteBuf>
ChannelHandler.Sharable| 构造器和说明 |
|---|
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) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在类中 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 在类中 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 在接口中 ChannelOutboundHandlerflush 在类中 ChannelOutboundHandlerAdapterctx - the ChannelHandlerContext for which the flush operation is madepublic void handlerAdded(ChannelHandlerContext ctx)
ChannelHandlerAdapterhandlerAdded 在接口中 ChannelHandlerhandlerAdded 在类中 ChannelHandlerAdapterpublic void handlerRemoved(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelHandlerAdapterhandlerRemoved 在接口中 ChannelHandlerhandlerRemoved 在类中 ChannelHandlerAdapterjava.lang.Exception