public class ByteUtilities
extends java.lang.Object
Constructor and Description |
---|
ByteUtilities() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
bytesToHex(byte[] bytes) |
static byte[] |
hexToBytes(java.lang.String hex) |
static byte[] |
merge(byte[] in1,
byte[] in2) |
static java.lang.String |
shortToHex(short amount) |
static byte[] |
toByteArray(int i)
Returns a byte array given an int, function is guaranteed to return a non-null value that is of length 4
|
static byte[] |
toHardenedOffset(int i) |
static byte[] |
trimHead(byte[] in,
int amount) |
static byte[] |
trimTail(byte[] in,
int amount) |
public static byte[] merge(byte[] in1, byte[] in2)
public static byte[] trimHead(byte[] in, int amount)
public static byte[] trimTail(byte[] in, int amount)
public static java.lang.String shortToHex(short amount)
public static java.lang.String bytesToHex(byte[] bytes)
public static byte[] hexToBytes(java.lang.String hex)
public static byte[] toByteArray(int i)
i
- input integerpublic static byte[] toHardenedOffset(int i)