Class SnappyCompressor

java.lang.Object
org.iq80.snappy.SnappyCompressor

final class SnappyCompressor extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int
     
    private static final int
     
    private static final int
     
    private static final int
     
    private static final int
     
    private static final boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static int
     
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.