Class FastLzFrameDecoder

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler

public class FastLzFrameDecoder extends ByteToMessageDecoder
Uncompresses a ByteBuf encoded by FastLzFrameEncoder using the FastLZ algorithm. See FastLZ format.
  • Field Details

    • currentState

      private FastLzFrameDecoder.State currentState
    • checksum

      private final ByteBufChecksum checksum
      Underlying checksum calculator in use.
    • chunkLength

      private int chunkLength
      Length of current received chunk of data.
    • originalLength

      private int originalLength
      Original of current received chunk of data. It is equal to chunkLength for non compressed chunks.
    • isCompressed

      private boolean isCompressed
      Indicates is this chunk compressed or not.
    • hasChecksum

      private boolean hasChecksum
      Indicates is this chunk has checksum or not.
    • currentChecksum

      private int currentChecksum
      Checksum value of current received chunk of data which has checksum.
  • Constructor Details

    • FastLzFrameDecoder

      public FastLzFrameDecoder()
      Creates the fastest FastLZ decoder without checksum calculation.
    • FastLzFrameDecoder

      public FastLzFrameDecoder(boolean validateChecksums)
      Creates a FastLZ decoder with calculation of checksums as specified.
      Parameters:
      validateChecksums - 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 Adler32 as a default checksum calculator.
    • FastLzFrameDecoder

      public FastLzFrameDecoder(Checksum checksum)
      Creates a FastLZ decoder with specified checksum calculator.
      Parameters:
      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 Details