public class ArrayUtils
extends java.lang.Object
| Constructor and Description |
|---|
ArrayUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
concatenate(byte[]... arrays) |
static byte[] |
concatenate(byte[] a,
byte b) |
static byte[] |
concatenate(byte[] a,
byte[] b) |
static byte[] |
concatenate(byte a,
byte[] b) |
static byte[] |
getFirstNBytes(byte[] array,
int nBytes) |
static byte[] |
getLastNBytes(byte[] array,
int nBytes) |
static byte[] |
reverseArray(byte[] array) |
static byte[] |
toByteArray(int v)
Gets the given int as a byte array of length 4 in big-endian format.
|
static byte[] |
toByteArray(long v)
Gets the given long as a byte array of length 8 in big-endian format.
|
static byte[] |
toPrimitive(java.lang.Byte[] array) |
static byte[] |
trimLeadingBytes(byte[] bytes,
byte b) |
static byte[] |
trimLeadingZeroes(byte[] bytes) |
static byte[] |
trimTrailingBytes(byte[] bytes,
byte b) |
static byte[] |
xor(byte[] array1,
byte[] array2) |
public static byte[] reverseArray(byte[] array)
public static byte[] concatenate(byte[] a,
byte b)
public static byte[] concatenate(byte a,
byte[] b)
public static byte[] concatenate(byte[]... arrays)
public static byte[] concatenate(byte[] a,
byte[] b)
public static byte[] getFirstNBytes(byte[] array,
int nBytes)
public static byte[] getLastNBytes(byte[] array,
int nBytes)
public static byte[] xor(byte[] array1,
byte[] array2)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static byte[] trimLeadingBytes(byte[] bytes,
byte b)
public static byte[] trimLeadingZeroes(byte[] bytes)
public static byte[] trimTrailingBytes(byte[] bytes,
byte b)
public static byte[] toPrimitive(java.lang.Byte[] array)
public static byte[] toByteArray(int v)
v - The integer.public static byte[] toByteArray(long v)
v - The long.