final class SnappyCompressor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int |
BLOCK_LOG |
private static int |
BLOCK_SIZE |
private static int |
INPUT_MARGIN_BYTES |
private static int |
MAX_HASH_TABLE_BITS |
private static int |
MAX_HASH_TABLE_SIZE |
private static boolean |
NATIVE_LITTLE_ENDIAN |
Constructor and Description |
---|
SnappyCompressor() |
Modifier and Type | Method and Description |
---|---|
private static int |
bytesBetweenHashLookups(int skip) |
static int |
compress(byte[] uncompressed,
int uncompressedOffset,
int uncompressedLength,
byte[] compressed,
int compressedOffset) |
private static int |
compressFragment(byte[] input,
int inputOffset,
int inputSize,
byte[] output,
int outputIndex,
short[] table) |
private static int[] |
emitCopies(byte[] input,
int inputOffset,
int inputSize,
int ipIndex,
byte[] output,
int outputIndex,
short[] table,
int shift,
int candidateIndex) |
private static int |
emitCopy(byte[] output,
int outputIndex,
int offset,
int length) |
private static int |
emitCopyLessThan64(byte[] output,
int outputIndex,
int offset,
int length) |
private static int |
emitLiteral(byte[] output,
int outputIndex,
byte[] literal,
int literalIndex,
int length,
boolean allowFastPath) |
private static int[] |
findCandidate(byte[] input,
int ipIndex,
int ipLimit,
int inputOffset,
int shift,
short[] table,
int skip) |
private static int |
findMatchLength(byte[] s1,
int s1Index,
byte[] s2,
int s2Index,
int s2Limit) |
private static int |
getHashTableSize(int inputSize) |
private static int |
hashBytes(int bytes,
int shift) |
private static int |
log2Floor(int n) |
static int |
maxCompressedLength(int sourceLength) |
private static int |
writeUncompressedLength(byte[] compressed,
int compressedOffset,
int uncompressedLength)
Writes the uncompressed length as variable length integer.
|
private static final boolean NATIVE_LITTLE_ENDIAN
private static final int BLOCK_LOG
private static final int BLOCK_SIZE
private static final int INPUT_MARGIN_BYTES
private static final int MAX_HASH_TABLE_BITS
private static final int MAX_HASH_TABLE_SIZE
public static int maxCompressedLength(int sourceLength)
public static int compress(byte[] uncompressed, int uncompressedOffset, int uncompressedLength, byte[] compressed, int compressedOffset)
private static int compressFragment(byte[] input, int inputOffset, int inputSize, byte[] output, int outputIndex, short[] table)
private static int[] findCandidate(byte[] input, int ipIndex, int ipLimit, int inputOffset, int shift, short[] table, int skip)
private static int bytesBetweenHashLookups(int skip)
private static int[] emitCopies(byte[] input, int inputOffset, int inputSize, int ipIndex, byte[] output, int outputIndex, short[] table, int shift, int candidateIndex)
private static int emitLiteral(byte[] output, int outputIndex, byte[] literal, int literalIndex, int length, boolean allowFastPath)
private static int emitCopyLessThan64(byte[] output, int outputIndex, int offset, int length)
private static int emitCopy(byte[] output, int outputIndex, int offset, int length)
private static int findMatchLength(byte[] s1, int s1Index, byte[] s2, int s2Index, int s2Limit)
private static int getHashTableSize(int inputSize)
private static int hashBytes(int bytes, int shift)
private static int log2Floor(int n)
private static int writeUncompressedLength(byte[] compressed, int compressedOffset, int uncompressedLength)