|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--edu.virginia.cs.mng.hypercast.ByteArrayUtility
This class contains some general functions for reading values from a byte array and for writing values to a byte array.
| Constructor Summary | |
ByteArrayUtility()
|
|
| Method Summary | |
static boolean |
isBytesZero(byte[] data,
int start_index,
int length)
Checks out if a certain part of a byte array is all zero or not |
static void |
setBytesZero(byte[] data,
int start_index,
int length)
Sets a certain part of a byte array to all zeros |
static byte[] |
toByteArray(int value)
Converts an integer to a byte array |
static byte[] |
toByteArray(long value)
Converts a long to a byte array |
static byte[] |
toByteArray(short value)
Converts an short integer to a byte array |
static int |
toInteger(byte[] data,
int index)
Converts a byte array to an integer |
static long |
toLong(byte[] data,
int index)
Converts a byte array to a long integer |
static short |
toShort(byte[] data,
int index)
Converts a byte array to a short integer |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public ByteArrayUtility()
| Method Detail |
public static short toShort(byte[] data,
int index)
data - a byte arrayindex - a starting index in the array
public static int toInteger(byte[] data,
int index)
data - a byte arrayindex - a starting index in the array
public static long toLong(byte[] data,
int index)
data - a byte arrayindex - a starting index in the arraypublic static byte[] toByteArray(short value)
value - a short integerpublic static byte[] toByteArray(int value)
value - an integerpublic static byte[] toByteArray(long value)
longvalue - a long integer
public static boolean isBytesZero(byte[] data,
int start_index,
int length)
data - a byte arraystart_index - the start position to checklength - the total length of bytes to be checked
public static void setBytesZero(byte[] data,
int start_index,
int length)
data - a byte arraystart_index - the start position to setlength - the total length of bytes to be set
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||