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

public Class Bzip2Decoder

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

Uncompresses a ByteBuf encoded with the Bzip2 format. See Bzip2.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
Bzip2Decoder.State

Current state of stream.

Field Summary

Modifier and TypeField and Description
private int
blockCRC

The CRC of the current block as read from the block header.

private Bzip2BlockDecompressor
blockDecompressor

The decompressor for the current block.

private int
blockSize

Always: in the range 0 ..

private Bzip2Decoder.State
private Bzip2HuffmanStageDecoder
huffmanStageDecoder

Bzip2 Huffman coding stage.

private final Bzip2BitReader
reader

A reader that provides bit-level reads.

private int
streamCRC

The merged CRC of all blocks decompressed so far.

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

Constructor Summary

AccessConstructor and Description
public

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.
public boolean
isClosed()

Returns true if and only if the end of the compressed stream has been reached.

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

Field Detail

blockCRCback to summary
private int blockCRC

The CRC of the current block as read from the block header.

blockDecompressorback to summary
private Bzip2BlockDecompressor blockDecompressor

The decompressor for the current block.

blockSizeback to summary
private int blockSize

Always: in the range 0 .. 9. The current block size is 100000 * this number.

currentStateback to summary
private Bzip2Decoder.State currentState
huffmanStageDecoderback to summary
private Bzip2HuffmanStageDecoder huffmanStageDecoder

Bzip2 Huffman coding stage.

readerback to summary
private final Bzip2BitReader reader

A reader that provides bit-level reads.

streamCRCback to summary
private int streamCRC

The merged CRC of all blocks decompressed so far.

Constructor Detail

Bzip2Decoderback to summary
public Bzip2Decoder()

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
isClosedback to summary
public boolean isClosed()

Returns true if and only if the end of the compressed stream has been reached.

io.netty.handler.codec.compression back to summary

private final Enum Bzip2Decoder.State

extends Enum<Bzip2Decoder.State>
Class Inheritance

Current state of stream.

Field Summary

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

Constructor Summary

AccessConstructor and Description
private

Method Summary

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

Field Detail

DECODE_HUFFMAN_DATAback to summary
public static final Bzip2Decoder.State DECODE_HUFFMAN_DATA
EOFback to summary
public static final Bzip2Decoder.State EOF
INITback to summary
public static final Bzip2Decoder.State INIT
INIT_BLOCKback to summary
public static final Bzip2Decoder.State INIT_BLOCK
INIT_BLOCK_PARAMSback to summary
public static final Bzip2Decoder.State INIT_BLOCK_PARAMS
RECEIVE_HUFFMAN_LENGTHback to summary
public static final Bzip2Decoder.State RECEIVE_HUFFMAN_LENGTH
RECEIVE_HUFFMAN_USED_BITMAPSback to summary
public static final Bzip2Decoder.State RECEIVE_HUFFMAN_USED_BITMAPS
RECEIVE_HUFFMAN_USED_MAPback to summary
public static final Bzip2Decoder.State RECEIVE_HUFFMAN_USED_MAP
RECEIVE_SELECTORSback to summary
public static final Bzip2Decoder.State RECEIVE_SELECTORS
RECEIVE_SELECTORS_NUMBERback to summary
public static final Bzip2Decoder.State RECEIVE_SELECTORS_NUMBER

Constructor Detail

Stateback to summary
private State()

Method Detail

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