public class BytesUtil
extends java.lang.Object
| Constructor and Description |
|---|
BytesUtil() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
merge(byte[]... arrays)
Merge byte arrays.
|
static byte[] |
merge(byte[] a,
byte[] b)
Append two byte arrays
|
static java.math.BigInteger |
parse256(byte[] p)
parse256(p): interprets a 32-byte sequence as a 256-bit number, most
significant byte first.
|
static byte[] |
ser256(java.math.BigInteger p)
ser256(p): serializes the integer p as a 32-byte sequence, most significant
byte first.
|
static byte[] |
ser32(long i)
ser32(i): serialize a 32-bit unsigned integer i as a 4-byte sequence, most
significant byte first.
|
static byte[] |
ser32LE(long i)
ser32(i): serialize a 32-bit unsigned integer i as a 4-byte sequence, least
significant byte first.
|
public static byte[] ser32(long i)
Prefer long type to hold unsigned ints.
public static byte[] ser32LE(long i)
Prefer long type to hold unsigned ints.
public static byte[] ser256(java.math.BigInteger p)
p - big integerpublic static java.math.BigInteger parse256(byte[] p)
p - bytespublic static byte[] merge(byte[] a,
byte[] b)
a - first byte arrayb - second byte arraypublic static byte[] merge(byte[]... arrays)
arrays -