public final class BinaryUtils extends Object
| Modifier and Type | Method | Description |
|---|---|---|
static String |
convertBytesToHexString(byte[] data) |
Converts an array of bytes in to a String of hexadecimal characters (0 - F).
|
static int |
convertBytesToInt(byte[] bytes,
int offset) |
Take four bytes from the specified position in the specified
block and convert them into a 32-bit int, using the big-endian
convention.
|
static int[] |
convertBytesToInts(byte[] bytes) |
Convert an array of bytes into an array of ints.
|
static long |
convertBytesToLong(byte[] bytes,
int offset) |
Utility method to convert an array of bytes into a long.
|
static BitString |
convertDoubleToFixedPointBits(double value) |
Converts a floating point value in the range 0 - 1 into a fixed
point bit string (where the most significant bit has a value of 0.5).
|
static byte[] |
convertHexStringToBytes(String hex) |
Converts a hexadecimal String (such as one generated by the
convertBytesToHexString(byte[]) method) into an array of bytes. |
public static String convertBytesToHexString(byte[] data)
data - An array of bytes to convert to a String.public static byte[] convertHexStringToBytes(String hex)
convertBytesToHexString(byte[]) method) into an array of bytes.hex - The hexadecimal String to be converted into an array of bytes.public static int convertBytesToInt(byte[] bytes,
int offset)
bytes - The data to read from.offset - The position to start reading the 4-byte int from.public static int[] convertBytesToInts(byte[] bytes)
bytes - The data to read from.public static long convertBytesToLong(byte[] bytes,
int offset)
bytes - The data to read from.offset - The position to start reading the 8-byte long from.public static BitString convertDoubleToFixedPointBits(double value)
value - The value to convert (must be between zero and one).