public final class HexString extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
getHexByteArray(String hexValue)
Convert a hex value string to an array of bytes
|
static String |
getHexString(byte[] bytes)
Convert an array of bytes to a hex value string.
|
static String |
getHexString(String textValue)
String to hexify.
|
@Nonnull public static String getHexString(@Nonnull String textValue)
textValue
- Input textual string (eg. "something"). Cannot be null, cannot be empty.@Nonnull public static String getHexString(@Nonnull byte[] bytes)
bytes
- Input bytes. Cannot be null, cannot be empty.@Nonnull public static byte[] getHexByteArray(@Nonnull String hexValue)
hexValue
- Input hex value string (eg. "2abc"). Cannot be null, cannot be empty. Number 0-9 and both upper-
and lowercase hex characters a-f are accepted. If the input value string length is not even, a
'0' is prepended to it and the string is interpreted as consisting of 2-char hex digit pairs.IllegalArgumentException
- If the hexValue string contains non-hex characters.Copyright © 2018 TomTom International BV. All rights reserved.