public class LzfDecoder extends ByteToMessageDecoder
ByteBuf 。
请参阅原始LZF package和LZF format的完整说明。
ByteToMessageDecoder.CumulatorChannelHandler.SharableCOMPOSITE_CUMULATOR, MERGE_CUMULATOR| Constructor and Description |
|---|
LzfDecoder()
创建一个新的LZF解码器,其中包含用于底层数据访问的最佳可用方法。
|
LzfDecoder(boolean safeInstance)
用指定的解码实例创建一个新的LZF解码器。
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out)
解码从一个 ByteBuf到另一个。
|
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtensureNotSharable, handlerAdded, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAddedpublic LzfDecoder()
LzfDecoder(boolean)和true参数。
public LzfDecoder(boolean safeInstance)
safeInstance - 如果true解码器将使用仅使用标准JDK访问方法的ChunkDecoder ,并且应该适用于所有Java平台和JVM。
否则解码器将尝试使用高度优化的ChunkDecoder实现,该实现使用Sun JDK的Unsafe类(其他JDK也可能包含Unsafe )。
protected void decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws java.lang.Exception
ByteToMessageDecoder
decode在课堂
ByteToMessageDecoder
ctx - ByteToMessageDecoder所属的ChannelHandlerContext
in -所述ByteBuf从中读取数据
out - 应该添加解码消息的
List
java.lang.Exception - 发生错误时抛出
Copyright © 2008–2018 The Netty Project. All rights reserved.