java.lang.Object | |
↳ | org.apache.directmemory.memory.buffer.UnicodeUtil |
Class to encode java's UTF16 char[] into UTF8 byte[] without always allocating a new byte[] as String.getBytes("UTF-8") does.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | UNI_REPLACEMENT_CHAR | ||||||||||
int | UNI_SUR_HIGH_END | ||||||||||
int | UNI_SUR_HIGH_START | ||||||||||
int | UNI_SUR_LOW_END | ||||||||||
int | UNI_SUR_LOW_START |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Encode characters from the given
String , starting at offset 0 for length chars. | |||||||||||
Interprets the bytes from the given Source as UTF-8 and converts to UTF-16.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Encode characters from the given String
, starting at offset 0 for length chars. Returns length of the
encoded String in bytes.
Interprets the bytes from the given Source as UTF-8 and converts to UTF-16.
NOTE: Full characters are read, even if this reads past the length passed (and can result in an ArrayOutOfBoundsException if invalid UTF-8 is passed). Explicit checks for valid UTF-8 are not performed.