Class SnappyFrameDecoder

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
Direct Known Subclasses:
SnappyFramedDecoder

public class SnappyFrameDecoder extends ByteToMessageDecoder
Uncompresses a ByteBuf encoded with the Snappy framing format. See Snappy framing format. Note that by default, validation of the checksum header in each chunk is DISABLED for performance improvements. If performance is less of an issue, or if you would prefer the safety that checksum validation brings, please use the SnappyFrameDecoder(boolean) constructor with the argument set to true.
  • Field Details

    • SNAPPY_IDENTIFIER_LEN

      private static final int SNAPPY_IDENTIFIER_LEN
      See Also:
    • MAX_UNCOMPRESSED_DATA_SIZE

      private static final int MAX_UNCOMPRESSED_DATA_SIZE
      See Also:
    • MAX_DECOMPRESSED_DATA_SIZE

      private static final int MAX_DECOMPRESSED_DATA_SIZE
      See Also:
    • MAX_COMPRESSED_CHUNK_SIZE

      private static final int MAX_COMPRESSED_CHUNK_SIZE
      See Also:
    • snappy

      private final Snappy snappy
    • validateChecksums

      private final boolean validateChecksums
    • started

      private boolean started
    • corrupted

      private boolean corrupted
    • numBytesToSkip

      private int numBytesToSkip
  • Constructor Details

    • SnappyFrameDecoder

      public SnappyFrameDecoder()
      Creates a new snappy-framed decoder with validation of checksums turned OFF. To turn checksum validation on, please use the alternate SnappyFrameDecoder(boolean) constructor.
    • SnappyFrameDecoder

      public SnappyFrameDecoder(boolean validateChecksums)
      Creates a new snappy-framed decoder with validation 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
  • Method Details