| Modifier and Type | Field and Description |
|---|---|
| private static final Supplier | |
| public static final int | |
| public static final byte[] | HEADER_BYTES
The header consists of the stream identifier flag, 3 bytes indicating a length of 6, and "sNaPpY" in ASCII. |
| private static final int | |
| public static final int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public static Checksum | |
| public static int | mask(int crc)
Checksums are not stored directly, but masked, as checksumming data and then its own checksum can be problematic. |
| public static int | |
| pack-priv static final int | |
| pack-priv static int |
| CHECKSUM_SUPPLIER | back to summary |
|---|---|
| private static final Supplier<Checksum> CHECKSUM_SUPPLIER | |
| COMPRESSED_DATA_FLAG | back to summary |
|---|---|
| public static final int COMPRESSED_DATA_FLAG | |
| HEADER_BYTES | back to summary |
|---|---|
| public static final byte[] HEADER_BYTES The header consists of the stream identifier flag, 3 bytes indicating a length of 6, and "sNaPpY" in ASCII. | |
| MASK_DELTA | back to summary |
|---|---|
| private static final int MASK_DELTA | |
| STREAM_IDENTIFIER_FLAG | back to summary |
|---|---|
| public static final int STREAM_IDENTIFIER_FLAG | |
| UNCOMPRESSED_DATA_FLAG | back to summary |
|---|---|
| public static final int UNCOMPRESSED_DATA_FLAG | |
| SnappyFramed | back to summary |
|---|---|
| pack-priv SnappyFramed() | |
| getCRC32C | back to summary |
|---|---|
| public static Checksum getCRC32C() | |
| mask | back to summary |
|---|---|
| public static int mask(int crc) Checksums are not stored directly, but masked, as checksumming data and then its own checksum can be problematic. The masking is the same as used in Apache Hadoop: Rotate the checksum by 15 bits, then add the constant 0xa282ead8 (using wraparound as normal for unsigned integers). This is equivalent to the following C code:
uint32_t mask_checksum(uint32_t x) {
return ((x >> 15) | (x << 17)) + 0xa282ead8;
}
| |
| maskedCrc32c | back to summary |
|---|---|
| public static int maskedCrc32c(Checksum crc32c, byte[] data, int offset, int length) | |
| readBytes | back to summary |
|---|---|
| pack-priv static final int readBytes(ReadableByteChannel source, ByteBuffer dest) throws IOException | |
| skip | back to summary |
|---|---|
| pack-priv static int skip(final ReadableByteChannel source, final int skip, final ByteBuffer buffer) throws IOException | |