|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.util.Encoding
A collection of utility methods for manipulating character and byte data.
Nested Class Summary | |
static class |
Encoding.UnsupportedException
This is an unchecked exception. |
Method Summary | |
static byte[] |
getBytes(char ch,
String enc)
Returns the byte representation of the character ch in the
specified encoding enc . |
static boolean |
isSupportedEncoding(String enc)
Returns true if the character encoding enc is
supported by the host JVM. |
static String |
toHex(byte b)
Returns the hexadecimal representation of the byte, with the return value ranging from "0x00" to "0xFF". |
static String |
toHex(char ch)
Returns the hexadecimal representation of the character. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static String toHex(char ch)
For example, toHex('?')
is "0x0C03"
and
toHex('A')
is "0x0041"
.
public static String toHex(byte b)
For example, toHex((byte) 126)
is "0x7E"
and
toHex((byte) -2)
is "0xFE"
.
public static boolean isSupportedEncoding(String enc)
true
if the character encoding enc
is
supported by the host JVM.
public static byte[] getBytes(char ch, String enc)
ch
in the
specified encoding enc
. If the specified encoding is
"UTF-16", the result is a platform-dependent two-byte sequence, with the
byte-order mark (BOM) stripped out.
Encoding.UnsupportedException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |