Package org.iq80.snappy
Class SnappyInternalUtils
java.lang.Object
org.iq80.snappy.SnappyInternalUtils
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final booleanprivate static final Memory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static StringbadPositionIndex(int index, int size, String desc) (package private) static StringbadPositionIndexes(int start, int end, int size) (package private) static voidcheckArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs) (package private) static <T> TcheckNotNull(T reference, String errorMessageTemplate, Object... errorMessageArgs) (package private) static voidcheckPositionIndexes(int start, int end, int size) (package private) static voidcopyLong(byte[] src, int srcIndex, byte[] dest, int destIndex) (package private) static voidcopyMemory(byte[] input, int inputIndex, byte[] output, int outputIndex, int length) (package private) static booleanequals(byte[] left, int leftIndex, byte[] right, int rightIndex, int length) static intloadByte(byte[] data, int index) (package private) static intloadInt(byte[] data, int index) (package private) static longloadLong(byte[] data, int index) static intlookupShort(short[] data, int index) (package private) static intreadBytes(InputStream source, byte[] dest, int offset, int length) Reads length bytes from source into dest starting at offset.(package private) static intskip(InputStream source, int skip)
-
Field Details
-
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
-
checkArgument
-
checkPositionIndexes
static void checkPositionIndexes(int start, int end, int size) -
badPositionIndexes
-
badPositionIndex
-
readBytes
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 benull.dest- The byte[] to read bytes into. Must not benull.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
- Throws:
IOException
-