Package org.iq80.snappy
Class SnappyCompressor
java.lang.Object
org.iq80.snappy.SnappyCompressor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intbytesBetweenHashLookups(int skip) static intcompress(byte[] uncompressed, int uncompressedOffset, int uncompressedLength, byte[] compressed, int compressedOffset) private static intcompressFragment(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 intemitCopy(byte[] output, int outputIndex, int offset, int length) private static intemitCopyLessThan64(byte[] output, int outputIndex, int offset, int length) private static intemitLiteral(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 intfindMatchLength(byte[] s1, int s1Index, byte[] s2, int s2Index, int s2Limit) private static intgetHashTableSize(int inputSize) private static inthashBytes(int bytes, int shift) private static intlog2Floor(int n) static intmaxCompressedLength(int sourceLength) private static intwriteUncompressedLength(byte[] compressed, int compressedOffset, int uncompressedLength) Writes the uncompressed length as variable length integer.
-
Field Details
-
NATIVE_LITTLE_ENDIAN
private static final boolean NATIVE_LITTLE_ENDIAN -
BLOCK_LOG
private static final int BLOCK_LOG- See Also:
-
BLOCK_SIZE
private static final int BLOCK_SIZE- See Also:
-
INPUT_MARGIN_BYTES
private static final int INPUT_MARGIN_BYTES- See Also:
-
MAX_HASH_TABLE_BITS
private static final int MAX_HASH_TABLE_BITS- See Also:
-
MAX_HASH_TABLE_SIZE
private static final int MAX_HASH_TABLE_SIZE- See Also:
-
-
Constructor Details
-
SnappyCompressor
SnappyCompressor()
-
-
Method Details
-
maxCompressedLength
public static int maxCompressedLength(int sourceLength) -
compress
public static int compress(byte[] uncompressed, int uncompressedOffset, int uncompressedLength, byte[] compressed, int compressedOffset) -
compressFragment
private static int compressFragment(byte[] input, int inputOffset, int inputSize, byte[] output, int outputIndex, short[] table) -
findCandidate
private static int[] findCandidate(byte[] input, int ipIndex, int ipLimit, int inputOffset, int shift, short[] table, int skip) -
bytesBetweenHashLookups
private static int bytesBetweenHashLookups(int skip) -
emitCopies
private static int[] emitCopies(byte[] input, int inputOffset, int inputSize, int ipIndex, byte[] output, int outputIndex, short[] table, int shift, int candidateIndex) -
emitLiteral
private static int emitLiteral(byte[] output, int outputIndex, byte[] literal, int literalIndex, int length, boolean allowFastPath) -
emitCopyLessThan64
private static int emitCopyLessThan64(byte[] output, int outputIndex, int offset, int length) -
emitCopy
private static int emitCopy(byte[] output, int outputIndex, int offset, int length) -
findMatchLength
private static int findMatchLength(byte[] s1, int s1Index, byte[] s2, int s2Index, int s2Limit) -
getHashTableSize
private static int getHashTableSize(int inputSize) -
hashBytes
private static int hashBytes(int bytes, int shift) -
log2Floor
private static int log2Floor(int n) -
writeUncompressedLength
private static int writeUncompressedLength(byte[] compressed, int compressedOffset, int uncompressedLength) Writes the uncompressed length as variable length integer.
-