| Constructor and Description |
|---|
HexUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
getBytesFromHexString(String hex)
Given a string in
strictly hex format, return the corresponding byte[]. |
static org.apache.commons.lang3.CharSet |
getHexCharSet() |
static String[] |
getHexRanges() |
static boolean |
isHex(char... chars)
Return true if every character is valid hex
0-9, a-f, or A-F |
static String |
toHexString(byte[] bytes)
Convert each
byte into its 2 digit hexadecimal form. |
static String |
toHexString(String string,
String encoding)
Convert
string into a byte[] using the specified encoding, then convert each byte into its 2
digit hexadecimal form. |
protected static String |
toString(String[] tokens) |
static String |
toStringFromHex(String hex,
String encoding)
Given a string in
strictly hex format and the encoding that was used to produce the hex, convert it back to
a Java String. |
public HexUtils()
public static final org.apache.commons.lang3.CharSet getHexCharSet()
public static final String[] getHexRanges()
public static String toHexString(String string, String encoding) throws UnsupportedEncodingException
string into a byte[] using the specified encoding, then convert each byte into its 2
digit hexadecimal form.UnsupportedEncodingExceptionpublic static String toHexString(byte[] bytes)
byte into its 2 digit hexadecimal form.public static final boolean isHex(char... chars)
0-9, a-f, or A-Fpublic static final byte[] getBytesFromHexString(String hex)
strictly hex format, return the corresponding byte[]. strictly hex in the
context of this method means that the string:a-f, A-F, and 0-9public static final String toStringFromHex(String hex, String encoding) throws UnsupportedEncodingException
strictly hex format and the encoding that was used to produce the hex, convert it back to
a Java String. strictly hex in the context of this method means that the string:a-f, A-F, and 0-9UnsupportedEncodingExceptionCopyright © 2010–2014 The Kuali Foundation. All rights reserved.