Buffer using the Snappy framing format.
See Snappy framing format.
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | MIN_COMPRESSIBLE_LENGTH
The minimum amount that we'll consider actually attempting to compress. |
| private final Snappy | |
| private SnappyCompressor. | |
| private static final byte[] | STREAM_START
All streams should start with the "Stream identifier", containing chunk type 0xff, a length field of 0x6, and 'sNaPpY' in ASCII. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | calculateAndWriteChecksum(Buffer
The data to calculate the checksum for slice, Buffer The output buffer to write the checksum to out)Calculates and writes the 4-byte checksum to the output buffer |
| public void | |
| public Buffer | compress(Buffer
the in, BufferAllocator Buffer that contains the data to be compressed.the allocator)BufferAllocator that is used to allocate a new buffer (if needed) to write the
compressed bytes too.Implements io. Buffer and compress into a new Buffer that will be
allocated (if needed) from the BufferAllocator.
|
| public Buffer | finish(BufferAllocator allocator)
Implements io. |
| public boolean | isClosed()
Implements io. true if the decompressor was closed, false otherwise.
|
| public boolean | isFinished()
Implements io. true if the compressor was finished or closed.
|
| public static Supplier | |
| private static void | |
| private static void | writeChunkLength(Buffer
The buffer to write to out, int The length to write chunkLength)Writes the 2-byte chunk length to the output buffer. |
| private static void |
| MIN_COMPRESSIBLE_LENGTH | back to summary |
|---|---|
| private static final int MIN_COMPRESSIBLE_LENGTH The minimum amount that we'll consider actually attempting to compress. This value is preamble + the minimum length our Snappy service will compress (instead of just emitting a literal). | |
| snappy | back to summary |
|---|---|
| private final Snappy snappy | |
| state | back to summary |
|---|---|
| private SnappyCompressor. | |
| STREAM_START | back to summary |
|---|---|
| private static final byte[] STREAM_START All streams should start with the "Stream identifier", containing chunk type 0xff, a length field of 0x6, and 'sNaPpY' in ASCII. | |
| SnappyCompressor | back to summary |
|---|---|
| private SnappyCompressor() | |
| calculateAndWriteChecksum | back to summary |
|---|---|
| private static void calculateAndWriteChecksum(Buffer slice, Buffer out) Calculates and writes the 4-byte checksum to the output buffer | |
| close | back to summary |
|---|---|
| public void close() Implements io. Doc from io. #
Close the compressor. After this method was called
| |
| compress | back to summary |
|---|---|
| public Buffer compress(Buffer in, BufferAllocator allocator) throws CompressionException Implements io. Doc from io. This method will read from the input
| |
| finish | back to summary |
|---|---|
| public Buffer finish(BufferAllocator allocator) Implements io. Doc from io. By calling this method we signal that the compression stream is marked as finish. The returned | |
| 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
| |
| newFactory | back to summary |
|---|---|
| public static Supplier Creates a new snappy compressor factory.
| |
| setChunkLength | back to summary |
|---|---|
| private static void setChunkLength(Buffer out, int lengthIdx) | |
| writeChunkLength | back to summary |
|---|---|
| private static void writeChunkLength(Buffer out, int chunkLength) Writes the 2-byte chunk length to the output buffer.
| |
| writeUnencodedChunk | back to summary |
|---|---|
| private static void writeUnencodedChunk(Buffer in, Buffer out, int dataLength) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final SnappyCompressor. | |
| public static final SnappyCompressor. | |
| public static final SnappyCompressor. | |
| public static final SnappyCompressor. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static SnappyCompressor. | |
| public static SnappyCompressor. |
| Closed | back to summary |
|---|---|
| public static final SnappyCompressor. | |
| Finished | back to summary |
|---|---|
| public static final SnappyCompressor. | |
| Init | back to summary |
|---|---|
| public static final SnappyCompressor. | |
| Started | back to summary |
|---|---|
| public static final SnappyCompressor. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static SnappyCompressor. | |
| values | back to summary |
|---|---|
| public static SnappyCompressor. | |