|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kuali.common.util.HexUtils
public class HexUtils
A few (highly inefficient) methods for converting String's into the hex for a given encoding and back again.
| Constructor Summary | |
|---|---|
HexUtils()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HexUtils()
| Method Detail |
|---|
public static final org.apache.commons.lang3.CharSet getHexCharSet()
public static final String[] getHexRanges()
protected static final String toString(String[] tokens)
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-F
public 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-9
public 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-9
UnsupportedEncodingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||