|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.util.UTF8
This class contains two static tools for doing UTF-8 encoding and decoding.
UTF-8 is ASCII- transparent. It supports character sets requiring more than the seven bit ASCII base range of UTF-8, including Unicode, ISO-8859, ISO-10646, etc..
We do not use an ISO UCS code signature, and we do not use a Java Data I/O- style strlen prefix.
Constructor Summary | |
UTF8()
|
Method Summary | |
static XMLString |
decode(byte[] code)
Decode UTF-8 input, terminates decoding at a null character, value 0x0. |
static XMLString |
decode(byte[] code,
int off,
int many)
Decode UTF-8 input, terminates decoding at a null character, value 0x0. |
static byte[] |
encode(char[] str)
Encode string in UTF-8. |
static byte[] |
encode(char[] str,
int start,
int length,
byte[] bytbuf,
int offset)
Encode string in UTF-8. |
static byte[] |
encode(java.lang.String s)
Encode string in UTF-8. |
static byte[] |
encode(java.lang.String str,
byte[] bytbuf,
int offset)
|
static byte[] |
encode(java.lang.String str,
int start,
int length,
byte[] bytbuf,
int offset)
Encode string in UTF-8. |
static int |
encoded(char[] str,
int start,
int len)
Returns the length of the string encoded in UTF-8. |
static int |
encoded(java.lang.String str)
Returns the length of the string encoded in UTF-8. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UTF8()
Method Detail |
public static final XMLString decode(byte[] code)
java.lang.IllegalStateException
- Bad format.public static final XMLString decode(byte[] code, int off, int many)
java.lang.IllegalStateException
- Bad format.public static final byte[] encode(char[] str)
public static final byte[] encode(char[] str, int start, int length, byte[] bytbuf, int offset)
public static final byte[] encode(java.lang.String str, byte[] bytbuf, int offset)
public static final byte[] encode(java.lang.String str, int start, int length, byte[] bytbuf, int offset)
public static final byte[] encode(java.lang.String s)
public static final int encoded(java.lang.String str)
public static final int encoded(char[] str, int start, int len)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |