public class ByteUtils
extends java.lang.Object
| Constructor and Description |
|---|
ByteUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
byteArrayToHexString(byte[] array)
Gets a pretty representation of a Byte Array as a HEX String.
|
static boolean |
doesArrayBeginWith(byte[] array,
byte[] prefix)
Checks to see if a byte arry starts with another byte array.
|
static int |
getIntFrom2ByteArray(byte[] input)
Converts a byte array with a length of 2 into an int
|
static int |
getIntFromByte(byte bite)
Converts a byte to an int, preserving the sign.
|
static int |
getIntFromByteArray(byte[] bytes)
Converts a byte array to an int.
|
static long |
getLongFromByteArray(byte[] bytes)
Converts a byte array to a long.
|
static byte[] |
invertArray(byte[] array)
Inverts an array
|
public static java.lang.String byteArrayToHexString(byte[] array)
array - the arraypublic static boolean doesArrayBeginWith(byte[] array,
byte[] prefix)
array - the arrayprefix - the prefixpublic static int getIntFrom2ByteArray(byte[] input)
input - the inputpublic static int getIntFromByte(byte bite)
bite - the bitepublic static int getIntFromByteArray(byte[] bytes)
bytes - the bytespublic static long getLongFromByteArray(byte[] bytes)
bytes - the bytespublic static byte[] invertArray(byte[] array)
array - the array