|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.buck.commons.algorithms.BinaryData
public final class BinaryData
Utilities to convert primitive data types to and from byte arrays.
| Field Summary | |
|---|---|
static int |
sizeOfByte
The size of a byte. |
static int |
sizeOfInt
The size of an int. |
static int |
sizeOfLong
The size of a long. |
static int |
sizeOfShort
The size of a short. |
| Constructor Summary | |
|---|---|
BinaryData()
|
|
| Method Summary | |
|---|---|
static byte |
loadByteAtOffset(byte[] array,
int offset)
Load a byte primitive type located at the indicated offset in the byte array. |
static byte |
loadByteAtOffsetUnsafe(byte[] array,
int offset)
Load a short primitive type located at the indicated offset in the byte array. |
static int |
loadIntAtOffset(byte[] array,
int offset)
Load a long primitive type located at the indicated offset in the byte array. |
static int |
loadIntAtOffsetUnsafe(byte[] array,
int offset)
Load a long primitive type located at the indicated offset in the byte array. |
static long |
loadLongAtOffset(byte[] array,
int offset)
Load a long primitive type located at the indicated offset in the byte array. |
static long |
loadLongAtOffsetUnsafe(byte[] array,
int offset)
Load a long primitive type located at the indicated offset in the byte array. |
static short |
loadShortAtOffset(byte[] array,
int offset)
Load a short primitive type located at the indicated offset in the byte array. |
static short |
loadShortAtOffsetUnsafe(byte[] array,
int offset)
Load a short primitive type located at the indicated offset in the byte array. |
static void |
storeByteAtOffset(byte[] array,
int offset,
byte value)
Store a byte primitive type at the indicated offset in the byte array. |
static void |
storeByteAtOffsetUnsafe(byte[] array,
int offset,
byte value)
Store a byte primitive type at the indicated offset in the byte array. |
static void |
storeIntAtOffset(byte[] array,
int offset,
int value)
Store a int primitive type at the indicated offset in the byte array. |
static void |
storeIntAtOffsetUnsafe(byte[] array,
int offset,
int value)
Store a long primitive type at the indicated offset in the byte array. |
static void |
storeLongAtOffset(byte[] array,
int offset,
long value)
Store a long primitive type at the indicated offset in the byte array. |
static void |
storeLongAtOffsetUnsafe(byte[] array,
int offset,
long value)
Store a long primitive type at the indicated offset in the byte array. |
static void |
storeShortAtOffset(byte[] array,
int offset,
short value)
Store a short primitive type at the indicated offset in the byte array. |
static void |
storeShortAtOffsetUnsafe(byte[] array,
int offset,
short value)
Store a short primitive type at the indicated offset in the byte array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int sizeOfByte
public static final int sizeOfShort
public static final int sizeOfInt
public static final int sizeOfLong
| Constructor Detail |
|---|
public BinaryData()
| Method Detail |
|---|
public static void storeByteAtOffset(byte[] array,
int offset,
byte value)
throws IndexOutOfBoundsException
array - the byte array to store the byte intooffset - the offset at which to store the bytevalue - the byte data to store at array[offset]
IndexOutOfBoundsException - if the offset is less than zero or
greater than the array length minus the
sizeof a byte.
public static void storeByteAtOffsetUnsafe(byte[] array,
int offset,
byte value)
array - the byte array to store the byte intooffset - the offset at which to store the bytevalue - the byte data to store at array[offset]
public static byte loadByteAtOffset(byte[] array,
int offset)
throws IndexOutOfBoundsException
array - the byte array to load the byte fromoffset - the offset from which to load the byte
IndexOutOfBoundsException - if the offset is less than zero or
greater than the array length minus the
sizeof a byte.
public static byte loadByteAtOffsetUnsafe(byte[] array,
int offset)
array - the byte array to load the byte fromoffset - the offset from which to load the byte
public static void storeShortAtOffset(byte[] array,
int offset,
short value)
throws IndexOutOfBoundsException
array - the byte array to store the short intooffset - the offset at which to store the shortvalue - the short data to store at array[offset]
IndexOutOfBoundsException - if the offset is less than zero or
greater than the array length minus the
sizeof a short.
public static void storeShortAtOffsetUnsafe(byte[] array,
int offset,
short value)
array - the byte array to store the short intooffset - the offset at which to store the shortvalue - the short data to store at array[offset]
public static short loadShortAtOffset(byte[] array,
int offset)
throws IndexOutOfBoundsException
array - the byte array to load the short fromoffset - the offset from which to load the short
IndexOutOfBoundsException - if the offset is less than zero or
greater than the array length minus the
sizeof a short.
public static short loadShortAtOffsetUnsafe(byte[] array,
int offset)
array - the byte array to load the short fromoffset - the offset from which to load the short
public static void storeIntAtOffset(byte[] array,
int offset,
int value)
throws IndexOutOfBoundsException
array - the byte array to store the long intooffset - the offset at which to store the longvalue - the int data to store at array[offset]
IndexOutOfBoundsException - if the offset is less than zero or
greater than the array length minus the
sizeof a long.
public static void storeIntAtOffsetUnsafe(byte[] array,
int offset,
int value)
array - the byte array to store the long intooffset - the offset at which to store the longvalue - the long data to store at array[offset]
public static int loadIntAtOffset(byte[] array,
int offset)
throws IndexOutOfBoundsException
array - the byte array to load the long fromoffset - the offset from which to load the long
IndexOutOfBoundsException - if the offset is less than zero or
greater than the array length minus the
sizeof a long.
public static int loadIntAtOffsetUnsafe(byte[] array,
int offset)
array - the byte array to load the long fromoffset - the offset from which to load the long
public static void storeLongAtOffset(byte[] array,
int offset,
long value)
throws IndexOutOfBoundsException
array - the byte array to store the long intooffset - the offset at which to store the longvalue - the long data to store at array[offset]
IndexOutOfBoundsException - if the offset is less than zero or
greater than the array length minus the
sizeof a long.
public static void storeLongAtOffsetUnsafe(byte[] array,
int offset,
long value)
array - the byte array to store the long intooffset - the offset at which to store the longvalue - the long data to store at array[offset]
public static long loadLongAtOffset(byte[] array,
int offset)
throws IndexOutOfBoundsException
array - the byte array to load the long fromoffset - the offset from which to load the long
IndexOutOfBoundsException - if the offset is less than zero or
greater than the array length minus the
sizeof a long.
public static long loadLongAtOffsetUnsafe(byte[] array,
int offset)
array - the byte array to load the long fromoffset - the offset from which to load the long
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||