public final class ByteUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
clone(byte[] array)
Deprecated.
Return a clone of the given byte array (performs null check beforehand).
|
static byte[] |
concatenate(byte[][] array)
Deprecated.
Convert a 2-dimensional byte array into a 1-dimensional byte array by
concatenating all entries.
|
static byte[] |
concatenate(byte[] x1,
byte[] x2)
Deprecated.
Concatenate two byte arrays.
|
static int |
deepHashCode(byte[] array)
Deprecated.
Computes a hashcode based on the contents of a one-dimensional byte array
rather than its identity.
|
static int |
deepHashCode(byte[][] array)
Deprecated.
Computes a hashcode based on the contents of a two-dimensional byte array
rather than its identity.
|
static int |
deepHashCode(byte[][][] array)
Deprecated.
Computes a hashcode based on the contents of a three-dimensional byte
array rather than its identity.
|
static boolean |
equals(byte[][][] left,
byte[][][] right)
Deprecated.
Compare two three-dimensional byte arrays.
|
static boolean |
equals(byte[][] left,
byte[][] right)
Deprecated.
Compare two two-dimensional byte arrays.
|
static boolean |
equals(byte[] left,
byte[] right)
Deprecated.
Compare two byte arrays (perform null checks beforehand).
|
static byte[] |
fromHexString(java.lang.String s)
Deprecated.
Convert a string containing hexadecimal characters to a byte-array.
|
static byte[][] |
split(byte[] input,
int index)
Deprecated.
Split a byte array input into two arrays at index,
i.e. the first array will have the lower index bytes, the
second one the higher input.length - index bytes.
|
static byte[] |
subArray(byte[] input,
int start)
Deprecated.
Generate a subarray of a given byte array.
|
static byte[] |
subArray(byte[] input,
int start,
int end)
Deprecated.
Generate a subarray of a given byte array.
|
static java.lang.String |
toBinaryString(byte[] input)
Deprecated.
Convert a byte array to the corresponding bit string.
|
static char[] |
toCharArray(byte[] input)
Deprecated.
Rewrite a byte array as a char array
|
static java.lang.String |
toHexString(byte[] input)
Deprecated.
Convert a byte array to the corresponding hexstring.
|
static java.lang.String |
toHexString(byte[] input,
java.lang.String prefix,
java.lang.String seperator)
Deprecated.
Convert a byte array to the corresponding hex string.
|
static byte[] |
xor(byte[] x1,
byte[] x2)
Deprecated.
Compute the bitwise XOR of two arrays of bytes.
|
public static boolean equals(byte[] left, byte[] right)
left
- the first byte arrayright
- the second byte arraypublic static boolean equals(byte[][] left, byte[][] right)
left
- the first byte arrayright
- the second byte arraypublic static boolean equals(byte[][][] left, byte[][][] right)
left
- the first byte arrayright
- the second byte arraypublic static int deepHashCode(byte[] array)
array
- the array to compute the hashcode ofpublic static int deepHashCode(byte[][] array)
array
- the array to compute the hashcode ofpublic static int deepHashCode(byte[][][] array)
array
- the array to compute the hashcode ofpublic static byte[] clone(byte[] array)
array
- the array to clonepublic static byte[] fromHexString(java.lang.String s)
s
- a hex stringpublic static java.lang.String toHexString(byte[] input)
input
- the byte array to be convertedpublic static java.lang.String toHexString(byte[] input, java.lang.String prefix, java.lang.String seperator)
input
- the byte array to be convertedprefix
- the prefix to put at the beginning of the hex stringseperator
- a separator stringpublic static java.lang.String toBinaryString(byte[] input)
input
- the byte array to be convertedpublic static byte[] xor(byte[] x1, byte[] x2)
x1
- the first arrayx2
- the second arraypublic static byte[] concatenate(byte[] x1, byte[] x2)
x1
- the first arrayx2
- the second arraypublic static byte[] concatenate(byte[][] array)
array
- a 2-dimensional byte arraypublic static byte[][] split(byte[] input, int index) throws java.lang.ArrayIndexOutOfBoundsException
input
- the byte array to be splitindex
- the index where the byte array is splitjava.lang.ArrayIndexOutOfBoundsException
- if index is out of boundspublic static byte[] subArray(byte[] input, int start, int end)
input
- the input byte arraystart
- the start indexend
- the end indexpublic static byte[] subArray(byte[] input, int start)
input
- the input byte arraystart
- the start indexpublic static char[] toCharArray(byte[] input)
input
- -
the byte array