public class FastLzFrameDecoder extends ByteToMessageDecoder
FastLzFrameEncoder编码的ByteBuf 。
见FastLZ format 。
ByteToMessageDecoder.CumulatorChannelHandler.SharableCOMPOSITE_CUMULATOR, MERGE_CUMULATOR| Constructor and Description |
|---|
FastLzFrameDecoder()
无需校验和计算即可创建最快的FastLZ解码器。
|
FastLzFrameDecoder(boolean validateChecksums)
创建一个FastLZ解码器,并根据指定的计算校验和。
|
FastLzFrameDecoder(java.util.zip.Checksum checksum)
用指定的校验和计算器创建一个FastLZ解码器。
|
| 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 FastLzFrameDecoder()
public FastLzFrameDecoder(boolean validateChecksums)
validateChecksums - 如果为true,校验和字段将根据实际的未压缩数据进行验证,如果校验和不匹配,则会引发合适的DecompressionException 。
请注意,在这种情况下,解码器将使用Adler32作为默认校验和计算器。
public FastLzFrameDecoder(java.util.zip.Checksum checksum)
checksum - 用于检查数据完整性的Checksum实例。
如果您不想验证每个块的校验和,则可以设置null 。
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.