Class Bzip2Decoder

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler

public class Bzip2Decoder extends ByteToMessageDecoder
Uncompresses a ByteBuf encoded with the Bzip2 format. See Bzip2.
  • Field Details

    • currentState

      private Bzip2Decoder.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 Details

    • Bzip2Decoder

      public Bzip2Decoder()
  • Method Details

    • decode

      protected void decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws java.lang.Exception
      Description copied from class: ByteToMessageDecoder
      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.
      Specified by:
      decode in class ByteToMessageDecoder
      Parameters:
      ctx - the ChannelHandlerContext which this ByteToMessageDecoder belongs to
      in - the ByteBuf from which to read data
      out - the List to which decoded messages should be added
      Throws:
      java.lang.Exception - is thrown if an error occurs
    • isClosed

      public boolean isClosed()
      Returns true if and only if the end of the compressed stream has been reached.