public class Converter
extends java.lang.Object
Constructor and Description |
---|
Converter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
asHex(byte[] buf)
Converts bytes to a hex string
|
static byte[] |
bitSetToByteArray(java.util.BitSet bits)
Provides a byte array of at least length 1, with the most significant bit guaranteed not to be a 1 (since BitSet
does not support sign extension); byte-ordering of the result is big-endian (most significant bit is in element 0);
bit at index 0 of the bit set is assumed to be the least significant bit
|
static java.util.BitSet |
byteArrayToBitSet(byte[] bytes)
Provides a bitset containing the values in a byte array; byte-ordering of the byte array must be big-endian (most
significant bit in element 0)
|
static int[] |
byteArrayToIndices(byte[] bytes)
Converts a byte array to a set of indices
|
public static java.util.BitSet byteArrayToBitSet(byte[] bytes)
bytes
- the array of bytespublic static byte[] bitSetToByteArray(java.util.BitSet bits)
bits
- the bitsetpublic static java.lang.String asHex(byte[] buf)
buf
- the array of bytespublic static int[] byteArrayToIndices(byte[] bytes)
bytes
- the byte array