|
||||||||||
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 that, when given an encoding, can convert Java String's
into the hex for that encoding
and also convert the hex back into the original string.
Constructor Summary | |
---|---|
HexUtils()
|
Method Summary | |
---|---|
static byte[] |
getBytesFromHexString(String hex)
Given a string in strictly hex format, return the corresponding byte[] . |
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. |
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 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.
UnsupportedEncodingException
public static String toHexString(byte[] bytes)
byte
into its 2 digit hexadecimal form.
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 |