public class LzmaFrameEncoder extends MessageToByteEncoder<ByteBuf>
ByteBuf
using the LZMA algorithm.
See LZMA
and LZMA format
or documents in LZMA SDK archive.ChannelHandler.Sharable
Constructor and Description |
---|
LzmaFrameEncoder()
Creates LZMA encoder with default settings.
|
LzmaFrameEncoder(int dictionarySize)
Creates LZMA encoder with specified dictionary size and default values of
lc = ,
lp = ,
pb = . |
LzmaFrameEncoder(int lc,
int lp,
int pb)
Creates LZMA encoder with specified
lc , lp , pb
values and the medium dictionary size of . |
LzmaFrameEncoder(int lc,
int lp,
int pb,
int dictionarySize)
Creates LZMA encoder with specified
lc , lp , pb values and custom dictionary size. |
LzmaFrameEncoder(int lc,
int lp,
int pb,
int dictionarySize,
boolean endMarkerMode,
int numFastBytes)
Creates LZMA encoder with specified settings.
|
Modifier and Type | Method and Description |
---|---|
protected ByteBuf |
allocateBuffer(ChannelHandlerContext ctx,
ByteBuf in,
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 . |
acceptOutboundMessage, isPreferDirect, write
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
public LzmaFrameEncoder()
public LzmaFrameEncoder(int lc, int lp, int pb)
lc
, lp
, pb
values and the medium dictionary size of .public LzmaFrameEncoder(int dictionarySize)
lc
= ,
lp
= ,
pb
= .public LzmaFrameEncoder(int lc, int lp, int pb, int dictionarySize)
lc
, lp
, pb
values and custom dictionary size.public LzmaFrameEncoder(int lc, int lp, int pb, int dictionarySize, boolean endMarkerMode, int numFastBytes)
lc
- the number of "literal context" bits, available values [0, 8], default value .lp
- the number of "literal position" bits, available values [0, 4], default value .pb
- the number of "position" bits, available values [0, 4], default value .dictionarySize
- available values [0, Integer.MAX_VALUE
],
default value is .endMarkerMode
- indicates should LzmaFrameEncoder
use end of stream marker or not.
Note, that LzmaFrameEncoder
always sets size of uncompressed data
in LZMA header, so EOS marker is unnecessary. But you may use it for
better portability. For full description see "LZMA Decoding modes" section
of LZMA-Specification.txt in official LZMA SDK.numFastBytes
- available values [, ].protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception
MessageToByteEncoder
ByteBuf
. 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 occursprotected ByteBuf allocateBuffer(ChannelHandlerContext ctx, ByteBuf in, boolean preferDirect) throws Exception
MessageToByteEncoder
ByteBuf
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
in class MessageToByteEncoder<ByteBuf>
Exception
Copyright © 2008–2017 The Netty Project. All rights reserved.