|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jrdf.util.btree.ByteArrayUtil
public class ByteArrayUtil
Class providing utility methods for handling byte arrays.
| Constructor Summary | |
|---|---|
ByteArrayUtil()
|
|
| Method Summary | |
|---|---|
static int |
compareRegion(byte[] array1,
int startIdx1,
byte[] array2,
int startIdx2,
int length)
Compares two regions of bytes, indicating whether one is larger than the other. |
static byte[] |
get(byte[] array,
int offset)
Gets the subarray from array that starts at offset. |
static byte[] |
get(byte[] array,
int offset,
int length)
Gets the subarray of length length from array that starts at offset. |
static int |
getInt(byte[] array,
int offset)
|
static long |
getLong(byte[] array,
int offset)
|
static boolean |
matchesPattern(byte[] value,
byte[] mask,
byte[] pattern)
Checks whether value matches pattern after mask has bee applied to value. |
static void |
put(byte[] source,
byte[] target,
int offset)
Puts the entire source array in the target array at offset offset. |
static void |
putInt(int value,
byte[] array,
int offset)
|
static void |
putLong(long value,
byte[] array,
int offset)
|
static boolean |
regionMatches(byte[] subValue,
byte[] superValue,
int offset)
Checks whether subValue matches the region in superValue starting at offset offset. |
static String |
toHexString(byte[] array)
Returns the hexadecimal value of the supplied byte array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteArrayUtil()
| Method Detail |
|---|
public static void put(byte[] source,
byte[] target,
int offset)
public static byte[] get(byte[] array,
int offset)
public static byte[] get(byte[] array,
int offset,
int length)
public static void putInt(int value,
byte[] array,
int offset)
public static int getInt(byte[] array,
int offset)
public static void putLong(long value,
byte[] array,
int offset)
public static long getLong(byte[] array,
int offset)
public static boolean matchesPattern(byte[] value,
byte[] mask,
byte[] pattern)
public static boolean regionMatches(byte[] subValue,
byte[] superValue,
int offset)
public static int compareRegion(byte[] array1,
int startIdx1,
byte[] array2,
int startIdx2,
int length)
array1 - The first byte array.startIdx1 - The start of the region in the first array.array2 - The second byte array.startIdx2 - The start of the region in the second array.length - The length of the region that should be compared.
public static String toHexString(byte[] array)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||