Package host.anzo.commons.utils
Class HexUtils
java.lang.Object
host.anzo.commons.utils.HexUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull StringbyteArrayToHex(byte @NotNull [] bytes) Converts a byte array to a hexadecimal string representation.static StringbyteArrayToHexTable(byte[] data) Converts a byte array to a formatted hexadecimal table string.static StringbyteArrayToHexTable(ByteBuffer data, int size) Converts a byte array to a formatted hexadecimal table string.static byte[]Converts a hexadecimal string to a byte array.static byte @NotNull []stringToHexByteArray(@NotNull String string) Converts a string of space-separated hexadecimal values into a byte array.static @NotNull StringstringToHexString(@NotNull String string) Converts a string to a hexadecimal string representation.
-
Constructor Details
-
HexUtils
public HexUtils()
-
-
Method Details
-
stringToHexByteArray
Converts a string of space-separated hexadecimal values into a byte array.- Parameters:
string- the string containing space-separated hexadecimal values- Returns:
- the byte array converted from the string
-
stringToHexString
Converts a string to a hexadecimal string representation.- Parameters:
string- the string to convert- Returns:
- the hexadecimal string representation of the input string
-
byteArrayToHex
Converts a byte array to a hexadecimal string representation.- Parameters:
bytes- the byte array to convert- Returns:
- the hexadecimal string representation of the byte array
-
hexStringToByteArray
Converts a hexadecimal string to a byte array.- Parameters:
str- the hexadecimal string to convert- Returns:
- the byte array converted from the string
-
byteArrayToHexTable
Converts a byte array to a formatted hexadecimal table string.- Parameters:
data- the byte buffer containing the data to be convertedsize- the number of bytes to convert- Returns:
- the formatted hexadecimal table string
-
byteArrayToHexTable
Converts a byte array to a formatted hexadecimal table string.- Parameters:
data- the byte array to convert- Returns:
- the formatted hexadecimal table string
-