final class SnappyFramed
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
COMPRESSED_DATA_FLAG |
static byte[] |
HEADER_BYTES
The header consists of the stream identifier flag, 3 bytes indicating a
length of 6, and "sNaPpY" in ASCII.
|
private static int |
MASK_DELTA |
static int |
STREAM_IDENTIFIER_FLAG |
private static java.lang.reflect.Method |
SUN_BUFFER_CLEANER |
private static java.lang.reflect.Method |
SUN_CLEANER_CLEAN |
private static java.lang.Class<? extends java.nio.ByteBuffer> |
SUN_DIRECT_BUFFER
Sun specific mechanisms to clean up resources associated with direct byte buffers.
|
static int |
UNCOMPRESSED_DATA_FLAG |
Constructor and Description |
---|
SnappyFramed() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.Class<?> |
lookupClassQuietly(java.lang.String name) |
static int |
mask(int crc)
Checksums are not stored directly, but masked, as checksumming data and
then its own checksum can be problematic.
|
static int |
maskedCrc32c(byte[] data) |
static int |
maskedCrc32c(byte[] data,
int offset,
int length) |
(package private) static int |
readBytes(java.nio.channels.ReadableByteChannel source,
java.nio.ByteBuffer dest) |
(package private) static void |
releaseDirectByteBuffer(java.nio.ByteBuffer buffer)
Provides jvm implementation specific operation to aggressively release resources associated with buffer.
|
(package private) static int |
skip(java.nio.channels.ReadableByteChannel source,
int skip,
java.nio.ByteBuffer buffer) |
public static final int COMPRESSED_DATA_FLAG
public static final int UNCOMPRESSED_DATA_FLAG
public static final int STREAM_IDENTIFIER_FLAG
private static final int MASK_DELTA
private static final java.lang.Class<? extends java.nio.ByteBuffer> SUN_DIRECT_BUFFER
private static final java.lang.reflect.Method SUN_BUFFER_CLEANER
private static final java.lang.reflect.Method SUN_CLEANER_CLEAN
public static final byte[] HEADER_BYTES
public static int maskedCrc32c(byte[] data)
public static int maskedCrc32c(byte[] data, int offset, int length)
public static int mask(int crc)
uint32_t mask_checksum(uint32_t x) { return ((x >> 15) | (x << 17)) + 0xa282ead8; }
static final int readBytes(java.nio.channels.ReadableByteChannel source, java.nio.ByteBuffer dest) throws java.io.IOException
java.io.IOException
static int skip(java.nio.channels.ReadableByteChannel source, int skip, java.nio.ByteBuffer buffer) throws java.io.IOException
java.io.IOException
private static java.lang.Class<?> lookupClassQuietly(java.lang.String name)
static void releaseDirectByteBuffer(java.nio.ByteBuffer buffer)
buffer
- The ByteBuffer
to release. Must not be null
. Must be direct
.