public class ByteArray
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static int |
UNSIGNED_FFFFFFFF |
| Constructor | Description |
|---|---|
ByteArray() |
| Modifier and Type | Method | Description |
|---|---|---|
static byte[] |
append(byte[] first,
byte[] second) |
Add two byte arrays to each other.
|
static java.lang.String |
bytesToHex(byte[] bytes) |
Convert a byte array to a hexadecimal string.
|
static long |
fromBytes(byte[] value) |
Convert a byte array to a long.
|
static byte[] |
hexToBytes(java.lang.String s) |
Convert a hexadecimal string to a byte array.
|
static byte[] |
toBytes(long value,
int length) |
Convert a long to a byte array.
|
public static final int UNSIGNED_FFFFFFFF
public static java.lang.String bytesToHex(byte[] bytes)
bytes - The byte array to convert.public static byte[] hexToBytes(java.lang.String s)
s - The hexadecimal string to convert.public static byte[] append(byte[] first,
byte[] second)
first - The first array.second - The second byte array that should be appended to the first array.public static byte[] toBytes(long value,
int length)
value - The long to convert.length - The number of bytes to convert to. This allows for the conversion of shorts and ints.public static long fromBytes(byte[] value)
value - The array to convert.Copyright © 2018. All rights reserved.