Top Description Inners Fields Constructors Methods
io.netty.handler.codec.compression

public Class FastLzFrameDecoder

extends ByteToMessageDecoder
Class Inheritance
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelHandlerContext, io.netty.handler.codec.ByteToMessageDecoder, java.util.List, java.util.zip.Adler32, .Checksum

Uncompresses a ByteBuf encoded by FastLzFrameEncoder using the FastLZ algorithm. See FastLZ format.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
FastLzFrameDecoder.State

Current state of decompression.

Field Summary

Modifier and TypeField and Description
private final ByteBufChecksum
checksum

Underlying checksum calculator in use.

private int
chunkLength

Length of current received chunk of data.

private int
currentChecksum

Checksum value of current received chunk of data which has checksum.

private FastLzFrameDecoder.State
private boolean
hasChecksum

Indicates is this chunk has checksum or not.

private boolean
isCompressed

Indicates is this chunk compressed or not.

private int
originalLength

Original of current received chunk of data.

Inherited from io.netty.handler.codec.ByteToMessageDecoder:
COMPOSITE_CUMULATORMERGE_CUMULATOR

Constructor Summary

AccessConstructor and Description
public
FastLzFrameDecoder()

Creates the fastest FastLZ decoder without checksum calculation.

public
FastLzFrameDecoder(boolean
If true, the checksum field will be validated against the actual uncompressed data, and if the checksums do not match, a suitable DecompressionException will be thrown. Note, that in this case decoder will use java.util.zip.Adler32 as a default checksum calculator.
validateChecksums
)

Creates a FastLZ decoder with calculation of checksums as specified.

public
FastLzFrameDecoder(Checksum
the Checksum instance to use to check data for integrity. You may set null if you do not want to validate checksum of each block.
checksum
)

Creates a FastLZ decoder with specified checksum calculator.

Method Summary

Modifier and TypeMethod and Description
protected void
decode(ChannelHandlerContext ctx, ByteBuf
the ByteBuf from which to read data
in
,
List<Object>
the List to which decoded messages should be added
out
)

Implements abstract io.netty.handler.codec.ByteToMessageDecoder.decode.

Decode the from one ByteBuf to an other.
Inherited from io.netty.handler.codec.ByteToMessageDecoder:
actualReadableBytescallDecodechannelInactivechannelReadchannelReadCompletedecodeLastdiscardSomeReadByteshandlerRemovedhandlerRemoved0internalBufferisSingleDecodesetCumulatorsetDiscardAfterReadssetSingleDecodeuserEventTriggered

Field Detail

checksumback to summary
private final ByteBufChecksum checksum

Underlying checksum calculator in use.

chunkLengthback to summary
private int chunkLength

Length of current received chunk of data.

currentChecksumback to summary
private int currentChecksum

Checksum value of current received chunk of data which has checksum.

currentStateback to summary
private FastLzFrameDecoder.State currentState
hasChecksumback to summary
private boolean hasChecksum

Indicates is this chunk has checksum or not.

isCompressedback to summary
private boolean isCompressed

Indicates is this chunk compressed or not.

originalLengthback to summary
private int originalLength

Original of current received chunk of data. It is equal to chunkLength for non compressed chunks.

Constructor Detail

FastLzFrameDecoderback to summary
public FastLzFrameDecoder()

Creates the fastest FastLZ decoder without checksum calculation.

FastLzFrameDecoderback to summary
public FastLzFrameDecoder(boolean validateChecksums)

Creates a FastLZ decoder with calculation of checksums as specified.

Parameters
validateChecksums:boolean

If true, the checksum field will be validated against the actual uncompressed data, and if the checksums do not match, a suitable DecompressionException will be thrown. Note, that in this case decoder will use java.util.zip.Adler32 as a default checksum calculator.

FastLzFrameDecoderback to summary
public FastLzFrameDecoder(Checksum checksum)

Creates a FastLZ decoder with specified checksum calculator.

Parameters
checksum:Checksum

the Checksum instance to use to check data for integrity. You may set null if you do not want to validate checksum of each block.

Method Detail

decodeback to summary
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception

Implements abstract io.netty.handler.codec.ByteToMessageDecoder.decode.

Doc from io.netty.handler.codec.ByteToMessageDecoder.decode.

Decode the from one ByteBuf to an other. This method will be called till either the input ByteBuf has nothing to read when return from this method or till nothing was read from the input ByteBuf.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this ByteToMessageDecoder belongs to

in:ByteBuf

the ByteBuf from which to read data

out:List<Object>

the List to which decoded messages should be added

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
io.netty.handler.codec.compression back to summary

private final Enum FastLzFrameDecoder.State

extends Enum<FastLzFrameDecoder.State>
Class Inheritance

Current state of decompression.

Field Summary

Modifier and TypeField and Description
public static final FastLzFrameDecoder.State
public static final FastLzFrameDecoder.State
public static final FastLzFrameDecoder.State
public static final FastLzFrameDecoder.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static FastLzFrameDecoder.State
public static FastLzFrameDecoder.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CORRUPTEDback to summary
public static final FastLzFrameDecoder.State CORRUPTED
DECOMPRESS_DATAback to summary
public static final FastLzFrameDecoder.State DECOMPRESS_DATA
INIT_BLOCKback to summary
public static final FastLzFrameDecoder.State INIT_BLOCK
INIT_BLOCK_PARAMSback to summary
public static final FastLzFrameDecoder.State INIT_BLOCK_PARAMS

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static FastLzFrameDecoder.State valueOf(String name)
valuesback to summary
public static FastLzFrameDecoder.State[] values()