Class Bzip2Decompressor
java.lang.Object
io.netty.handler.codec.compression.InputBufferingDecompressor
io.netty.handler.codec.compression.Bzip2Decompressor
- All Implemented Interfaces:
Decompressor, AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classprivate static enumCurrent state of stream.Nested classes/interfaces inherited from interface Decompressor
Decompressor.AbstractDecompressorBuilder, Decompressor.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThe CRC of the current block as read from the block header.private Bzip2BlockDecompressorThe decompressor for the current block.private intAlways: in the range 0 ..private Bzip2Decompressor.Stateprivate Bzip2HuffmanStageDecoderBzip2 Huffman coding stage.private final intprivate final Bzip2BitReaderA reader that provides bit-level reads.private intThe merged CRC of all blocks decompressed so far.Fields inherited from class InputBufferingDecompressor
allocator -
Constructor Summary
ConstructorsConstructorDescriptionBzip2Decompressor(Bzip2Decompressor.Builder builder, ByteBufAllocator allocator) -
Method Summary
Modifier and TypeMethodDescriptionstatic Bzip2Decompressor.Builderbuilder()voidNotify the decompressor that the end of input has been reached.(package private) voidprocessInput(ByteBuf buf) Process some input.(package private) ByteBufprocessOutput(ByteBuf buf) Produce some output.status()Get the current status.Methods inherited from class InputBufferingDecompressor
addInput, available, close, takeOutput
-
Field Details
-
outputBufferSize
private final int outputBufferSize -
currentState
-
reader
A reader that provides bit-level reads. -
blockDecompressor
The decompressor for the current block. -
huffmanStageDecoder
Bzip2 Huffman coding stage. -
blockSize
private int blockSizeAlways: in the range 0 .. 9. The current block size is 100000 * this number. -
blockCRC
private int blockCRCThe CRC of the current block as read from the block header. -
streamCRC
private int streamCRCThe merged CRC of all blocks decompressed so far.
-
-
Constructor Details
-
Bzip2Decompressor
Bzip2Decompressor(Bzip2Decompressor.Builder builder, ByteBufAllocator allocator)
-
-
Method Details
-
processInput
Description copied from class:InputBufferingDecompressorProcess some input. The input buffer ownership does not transfer to this method: If there's still data unread after this method finishes, it will be buffered.- Specified by:
processInputin classInputBufferingDecompressor- Parameters:
buf- The input buffer- Throws:
DecompressionException
-
processOutput
Description copied from class:InputBufferingDecompressorProduce some output. The input buffer parameter may be read from to consume some more data, but note that this method must return a buffer even if the input is too short.- Specified by:
processOutputin classInputBufferingDecompressor- Parameters:
buf- The input buffer- Throws:
DecompressionException
-
endOfInput
Description copied from interface:DecompressorNotify the decompressor that the end of input has been reached. Some implementations may flush remaining data or throw an exception if the input is truncated, but most implementations do nothing. Only permitted forDecompressor.Status.NEED_INPUT.- Throws:
DecompressionException
-
status
Description copied from interface:DecompressorGet the current status. Like the other operations on this class, calling this method is not permitted if the decompressor has failed or was closed.- Returns:
- The current status
- Throws:
DecompressionException
-
builder
-