Buffer 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 SnappyDecompressor(boolean) constructor with the argument
set to true.
| Modifier and Type | Class and Description |
|---|---|
| private static enum | |
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final int | |
| private int | |
| private final Snappy | |
| private static final int | |
| private boolean | |
| private SnappyDecompressor. | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| private | SnappyDecompressor(boolean
If true, the checksum field will be validated against the actual
uncompressed data, and if the checksums do not match, a suitable
validateChecksums)DecompressionException will be thrownCreates a new snappy decompressor with validation of checksums as specified. |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public void | |
| public Buffer | decompress(Buffer
the in, BufferAllocator Buffer that contains the data to be decompressed.the allocator)BufferAllocator that is used to allocate a new buffer (if needed) to write the
decompressed bytes too.Implements io. Buffer and decompress into a new Buffer that will be
allocated (if needed) from the BufferAllocator.
|
| public boolean | isClosed()
Implements io. true if the decompressor was closed, false otherwise.
|
| public boolean | isFinished()
Implements io. true if the decompressor was finish.
|
| private static SnappyDecompressor. | mapChunkType(byte
The tag byte extracted from the stream type)Decodes the chunk type from the type tag byte. |
| public static Supplier | Returns: the factory.Creates a new snappy decompressor factory with validation of checksums turned OFF. |
| public static Supplier | Returns: the factory.If true, the checksum field will be validated against the actual
uncompressed data, and if the checksums do not match, a suitable
validateChecksums)DecompressionException will be thrownCreates a new snappy decompressor factory with validation of checksums as specified. |
| private void |
| MAX_COMPRESSED_CHUNK_SIZE | back to summary |
|---|---|
| private static final int MAX_COMPRESSED_CHUNK_SIZE | |
| MAX_DECOMPRESSED_DATA_SIZE | back to summary |
|---|---|
| private static final int MAX_DECOMPRESSED_DATA_SIZE | |
| MAX_UNCOMPRESSED_DATA_SIZE | back to summary |
|---|---|
| private static final int MAX_UNCOMPRESSED_DATA_SIZE | |
| numBytesToSkip | back to summary |
|---|---|
| private int numBytesToSkip | |
| snappy | back to summary |
|---|---|
| private final Snappy snappy | |
| SNAPPY_IDENTIFIER_LEN | back to summary |
|---|---|
| private static final int SNAPPY_IDENTIFIER_LEN | |
| started | back to summary |
|---|---|
| private boolean started | |
| state | back to summary |
|---|---|
| private SnappyDecompressor. | |
| validateChecksums | back to summary |
|---|---|
| private final boolean validateChecksums | |
| SnappyDecompressor | back to summary |
|---|---|
| private SnappyDecompressor(boolean validateChecksums) Creates a new snappy decompressor with validation of checksums as specified.
| |
| checkByte | back to summary |
|---|---|
| private static void checkByte(byte actual, byte expect) | |
| close | back to summary |
|---|---|
| public void close() Implements io. Doc from io. Close the decompressor. After this method was called
| |
| decompress | back to summary |
|---|---|
| public Buffer decompress(Buffer in, BufferAllocator allocator) throws DecompressionException Implements io. Doc from io. This method will read from the input isFinished() is false
input
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Implements io. Doc from io. Return | |
| isFinished | back to summary |
|---|---|
| public boolean isFinished() Implements io. Doc from io. Returns
| |
| mapChunkType | back to summary |
|---|---|
| private static SnappyDecompressor. Decodes the chunk type from the type tag byte.
| |
| newFactory | back to summary |
|---|---|
| public static Supplier Creates a new snappy decompressor factory with validation of checksums
turned OFF. To turn checksum validation on, please use the alternate
| |
| newFactory | back to summary |
|---|---|
| public static Supplier Creates a new snappy decompressor factory with validation of checksums as specified.
| |
| streamCorrupted | back to summary |
|---|---|
| private void streamCorrupted(String message) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final SnappyDecompressor. | |
| public static final SnappyDecompressor. | |
| public static final SnappyDecompressor. | |
| public static final SnappyDecompressor. | |
| public static final SnappyDecompressor. | |
| public static final SnappyDecompressor. | |
| public static final SnappyDecompressor. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static SnappyDecompressor. | |
| public static SnappyDecompressor. |
| COMPRESSED_DATA | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| CORRUPTED | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| FINISHED | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| RESERVED_SKIPPABLE | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| RESERVED_UNSKIPPABLE | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| STREAM_IDENTIFIER | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| UNCOMPRESSED_DATA | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| ChunkType | back to summary |
|---|---|
| private ChunkType() | |
| valueOf | back to summary |
|---|---|
| public static SnappyDecompressor. | |
| values | back to summary |
|---|---|
| public static SnappyDecompressor. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final SnappyDecompressor. | |
| public static final SnappyDecompressor. | |
| public static final SnappyDecompressor. | |
| public static final SnappyDecompressor. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static SnappyDecompressor. | |
| public static SnappyDecompressor. |
| CLOSED | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| CORRUPTED | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| DECODING | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| FINISHED | back to summary |
|---|---|
| public static final SnappyDecompressor. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static SnappyDecompressor. | |
| values | back to summary |
|---|---|
| public static SnappyDecompressor. | |