public class ByteArrayUtils extends Object
| Constructor and Description |
|---|
ByteArrayUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
compare(byte[] a1,
byte[] a2)
lexicographic comparison which returns 0 if one of the array is a subarray of the other one
|
static boolean |
equalsPrefix(byte[] a,
byte[] b,
int n)
Compares the first n bytes of two arrays.
|
static byte[] |
plusOne(byte[] a)
If the array is considered binary representation of an integer, add 1 to the integer and returns the corresponding binary representation.
|
static boolean |
startsWith(byte[] a,
byte[] b)
returns true if a starts with b
|
public static boolean startsWith(byte[] a,
byte[] b)
a - b - NullPointerException - if any of them is nullpublic static boolean equalsPrefix(byte[] a,
byte[] b,
int n)
a - - the first array to compareb - - the second array to comparen - - the number of bytes to compareNullPointerException - if any of them is nullpublic static byte[] plusOne(byte[] a)
a - public static int compare(byte[] a1,
byte[] a2)
a1 - a2 - Copyright © 2017 Space Applications Services. All rights reserved.