Class Bzip2Decompressor
- java.lang.Object
-
- io.netty.handler.codec.compression.InputBufferingDecompressor
-
- io.netty.handler.codec.compression.Bzip2Decompressor
-
- All Implemented Interfaces:
Decompressor,java.lang.AutoCloseable
@UnstableApi public final class Bzip2Decompressor extends InputBufferingDecompressor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBzip2Decompressor.Builderprivate static classBzip2Decompressor.StateCurrent state of stream.-
Nested classes/interfaces inherited from interface io.netty.handler.codec.compression.Decompressor
Decompressor.AbstractDecompressorBuilder, Decompressor.Status
-
-
Field Summary
Fields Modifier and Type Field Description private intblockCRCThe CRC of the current block as read from the block header.private Bzip2BlockDecompressorblockDecompressorThe decompressor for the current block.private intblockSizeAlways: in the range 0 ..private Bzip2Decompressor.StatecurrentStateprivate Bzip2HuffmanStageDecoderhuffmanStageDecoderBzip2 Huffman coding stage.private intoutputBufferSizeprivate Bzip2BitReaderreaderA reader that provides bit-level reads.private intstreamCRCThe merged CRC of all blocks decompressed so far.-
Fields inherited from class io.netty.handler.codec.compression.InputBufferingDecompressor
allocator
-
-
Constructor Summary
Constructors Constructor Description Bzip2Decompressor(Bzip2Decompressor.Builder builder, ByteBufAllocator allocator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Bzip2Decompressor.Builderbuilder()voidendOfInput()Notify 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.Decompressor.Statusstatus()Get the current status.-
Methods inherited from class io.netty.handler.codec.compression.InputBufferingDecompressor
addInput, available, close, takeOutput
-
-
-
-
Field Detail
-
outputBufferSize
private final int outputBufferSize
-
currentState
private Bzip2Decompressor.State currentState
-
reader
private final Bzip2BitReader reader
A reader that provides bit-level reads.
-
blockDecompressor
private Bzip2BlockDecompressor blockDecompressor
The decompressor for the current block.
-
huffmanStageDecoder
private Bzip2HuffmanStageDecoder huffmanStageDecoder
Bzip2 Huffman coding stage.
-
blockSize
private int blockSize
Always: in the range 0 .. 9. The current block size is 100000 * this number.
-
blockCRC
private int blockCRC
The CRC of the current block as read from the block header.
-
streamCRC
private int streamCRC
The merged CRC of all blocks decompressed so far.
-
-
Constructor Detail
-
Bzip2Decompressor
Bzip2Decompressor(Bzip2Decompressor.Builder builder, ByteBufAllocator allocator)
-
-
Method Detail
-
processInput
void processInput(ByteBuf buf) throws DecompressionException
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
ByteBuf processOutput(ByteBuf buf) throws DecompressionException
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
public void endOfInput() throws DecompressionExceptionDescription 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
public Decompressor.Status status() throws DecompressionException
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
@UnstableApi public static Bzip2Decompressor.Builder builder()
-
-