Class SnappyInternalUtils

java.lang.Object
org.iq80.snappy.SnappyInternalUtils

final class SnappyInternalUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final boolean
     
    private static final Memory
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static String
    badPositionIndex(int index, int size, String desc)
     
    (package private) static String
    badPositionIndexes(int start, int end, int size)
     
    (package private) static void
    checkArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs)
     
    (package private) static <T> T
    checkNotNull(T reference, String errorMessageTemplate, Object... errorMessageArgs)
     
    (package private) static void
    checkPositionIndexes(int start, int end, int size)
     
    (package private) static void
    copyLong(byte[] src, int srcIndex, byte[] dest, int destIndex)
     
    (package private) static void
    copyMemory(byte[] input, int inputIndex, byte[] output, int outputIndex, int length)
     
    (package private) static boolean
    equals(byte[] left, int leftIndex, byte[] right, int rightIndex, int length)
     
    static int
    loadByte(byte[] data, int index)
     
    (package private) static int
    loadInt(byte[] data, int index)
     
    (package private) static long
    loadLong(byte[] data, int index)
     
    static int
    lookupShort(short[] data, int index)
     
    (package private) static int
    readBytes(InputStream source, byte[] dest, int offset, int length)
    Reads length bytes from source into dest starting at offset.
    (package private) static int
    skip(InputStream source, int skip)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • memory

      private static final Memory memory
    • HAS_UNSAFE

      static final boolean HAS_UNSAFE
  • Constructor Details

    • SnappyInternalUtils

      private SnappyInternalUtils()
  • Method Details

    • equals

      static boolean equals(byte[] left, int leftIndex, byte[] right, int rightIndex, int length)
    • lookupShort

      public static int lookupShort(short[] data, int index)
    • loadByte

      public static int loadByte(byte[] data, int index)
    • loadInt

      static int loadInt(byte[] data, int index)
    • copyLong

      static void copyLong(byte[] src, int srcIndex, byte[] dest, int destIndex)
    • loadLong

      static long loadLong(byte[] data, int index)
    • copyMemory

      static void copyMemory(byte[] input, int inputIndex, byte[] output, int outputIndex, int length)
    • checkNotNull

      static <T> T checkNotNull(T reference, String errorMessageTemplate, Object... errorMessageArgs)
    • checkArgument

      static void checkArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs)
    • checkPositionIndexes

      static void checkPositionIndexes(int start, int end, int size)
    • badPositionIndexes

      static String badPositionIndexes(int start, int end, int size)
    • badPositionIndex

      static String badPositionIndex(int index, int size, String desc)
    • readBytes

      static int readBytes(InputStream source, byte[] dest, int offset, int length) throws IOException
      Reads length bytes from source into dest starting at offset.

      The only case where the length bytes will not be read is if source returns EOF.

      Parameters:
      source - The source of bytes to read from. Must not be null.
      dest - The byte[] to read bytes into. Must not be null.
      offset - The index in dest to start filling.
      length - The number of bytes to read.
      Returns:
      Total number of bytes actually read.
      Throws:
      IndexOutOfBoundsException - if offset or length are invalid.
      IOException
    • skip

      static int skip(InputStream source, int skip) throws IOException
      Throws:
      IOException