public class LzfEncoder extends MessageToByteEncoder<ByteBuf>
ByteBuf using the LZF format.
See original LZF package
and LZF format for full description.ChannelHandler.Sharable, ChannelHandler.Skip| Constructor and Description |
|---|
LzfEncoder()
Creates a new LZF encoder with the most optimal available methods for underlying data access.
|
LzfEncoder(boolean safeInstance)
Creates a new LZF encoder with specified encoding instance.
|
LzfEncoder(boolean safeInstance,
int totalLength)
Creates a new LZF encoder with specified settings.
|
LzfEncoder(int totalLength)
Creates a new LZF encoder with specified total length of encoded chunk.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
encode(ChannelHandlerContext ctx,
ByteBuf in,
ByteBuf out)
Encode a message into a
ByteBuf. |
acceptOutboundMessage, allocateBuffer, writebind, channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, exceptionCaught, flush, handlerAdded, handlerRemoved, isSharable, read, userEventTriggeredpublic LzfEncoder()
LzfEncoder(boolean) with true param.public LzfEncoder(boolean safeInstance)
safeInstance - If true encoder will use ChunkEncoder that only uses standard JDK access methods,
and should work on all Java platforms and JVMs.
Otherwise encoder will try to use highly optimized ChunkEncoder implementation that uses
Sun JDK's Unsafe class (which may be included by other JDK's as well).public LzfEncoder(int totalLength)
totalLength - Expected total length of content to compress; only matters for outgoing messages that is smaller
than maximum chunk size (64k), to optimize encoding hash tables.public LzfEncoder(boolean safeInstance,
int totalLength)
safeInstance - If true encoder will use ChunkEncoder that only uses standard JDK access methods,
and should work on all Java platforms and JVMs.
Otherwise encoder will try to use highly optimized ChunkEncoder implementation that uses
Sun JDK's Unsafe class (which may be included by other JDK's as well).totalLength - Expected total length of content to compress; only matters for outgoing messages that is smaller
than maximum chunk size (64k), to optimize encoding hash tables.protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception
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 writtenException - is thrown if an error accourCopyright © 2008–2015 The Netty Project. All rights reserved.