public class LzmaFrameEncoder extends MessageToByteEncoder<io.netty.buffer.ByteBuf>
ByteBuf
using the LZMA algorithm.
See LZMA
and LZMA format
or documents in LZMA SDK archive.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 io.netty.buffer.ByteBuf |
allocateBuffer(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
boolean preferDirect)
Allocate a
ByteBuf which will be used as argument of #encode(ChannelHandlerContext, I, ByteBuf) . |
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
io.netty.buffer.ByteBuf out)
Encode a message into a
ByteBuf . |
acceptOutboundMessage, isPreferDirect, write
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
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(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, io.netty.buffer.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<io.netty.buffer.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 io.netty.buffer.ByteBuf allocateBuffer(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.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<io.netty.buffer.ByteBuf>
Exception
Copyright © 2008–2019 The Netty Project. All rights reserved.