public class LzmaFrameEncoder extends MessageToByteEncoder<ByteBuf>
ByteBuf 。
请参阅LZMA和LZMA format或LZMA SDK归档文档。
ChannelHandler.Sharable| Constructor and Description |
|---|
LzmaFrameEncoder()
使用默认设置创建LZMA编码器。
|
LzmaFrameEncoder(int dictionarySize)
创建具有指定字典大小和默认值
lc =,
lp =,
pb =的LZMA编码器。
|
LzmaFrameEncoder(int lc, int lp, int pb)
创建具有指定的编码器LZMA
lc ,
lp ,
pb值和的介质字典大小。
|
LzmaFrameEncoder(int lc, int lp, int pb, int dictionarySize)
创建具有指定LZMA编码器
lc ,
lp ,
pb价值和自定义词典的大小。
|
LzmaFrameEncoder(int lc, int lp, int pb, int dictionarySize, boolean endMarkerMode, int numFastBytes)
用指定的设置创建LZMA编码器。
|
| Modifier and Type | Method and Description |
|---|---|
protected ByteBuf |
allocateBuffer(ChannelHandlerContext ctx, ByteBuf in, boolean preferDirect)
分配一个 ByteBuf ,它将用作#encode(ChannelHandlerContext, I, ByteBuf)参数。
|
protected void |
encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out)
将消息编码成 ByteBuf 。
|
acceptOutboundMessage, isPreferDirect, writebind, close, connect, deregister, disconnect, flush, readensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedpublic LzmaFrameEncoder()
public LzmaFrameEncoder(int lc,
int lp,
int pb)
lc ,
lp ,
pb值和的介质字典大小。
public LzmaFrameEncoder(int dictionarySize)
lc =,
lp =,
pb =的LZMA编码器。
public LzmaFrameEncoder(int lc,
int lp,
int pb,
int dictionarySize)
lc ,
lp ,
pb价值和自定义词典的大小。
public LzmaFrameEncoder(int lc,
int lp,
int pb,
int dictionarySize,
boolean endMarkerMode,
int numFastBytes)
lc - “文字上下文”位的数量,可用值[
lc ],默认值。
lp - “文字位置”位的数量,可用值[0,4],默认值。
pb - “位置”位的数量,可用值[0,4],默认值。
dictionarySize - 可用值[
Integer.MAX_VALUE ],默认值为。
endMarkerMode - 表示LzmaFrameEncoder应否使用流标记结束。
注意, LzmaFrameEncoder总是在LZMA头部中设置未压缩数据的大小,所以EOS标记是不必要的。
但是你可以使用它来获得更好的可移植性。
有关完整说明,请参阅官方LZMA SDK中LZMA-Specification.txt的“LZMA解码模式”部分。
numFastBytes - 可用值[,]。
protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws java.lang.Exception
MessageToByteEncoder
ByteBuf 。
这个方法将被编码器处理的每个书面信息调用。
encode在课程
MessageToByteEncoder<ByteBuf>
ctx - 此MessageToByteEncoder所属的ChannelHandlerContext
in - 要编码的消息
out - 将编写消息写入其中的ByteBuf
java.lang.Exception - 如果发生错误则抛出
protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, ByteBuf in, boolean preferDirect) throws java.lang.Exception
MessageToByteEncoder
ByteBuf ,其将被用作参数的#encode(ChannelHandlerContext, I, ByteBuf) 。
子类可以覆盖此方法以返回ByteBuf ,其中匹配initialCapacity 。
allocateBuffer在类
MessageToByteEncoder<ByteBuf>
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.