public static int UTF8toUTF16(byte utf8,
Converts utf8 to utf16 and returns the number of 16 bit Java chars written.
Full characters are read, even if this reads past the length passed (and can result in
an ArrayOutOfBoundsException if invalid UTF8 is passed). Explicit checks for valid UTF8 are not performed.
The char out should probably have enough room to hold the worst case of each byte becoming a Java char.
public static void UTF8toUTF16(byte utf8,
Convert UTF8 bytes into UTF16 characters.
public static String UTF8toUTF16(byte utf8,
Convert UTF8 bytes into a String
public static int UTF16toUTF8(CharSequence s,
Writes UTF8 into the byte array, starting at offset. The caller should ensure that
there is enough space for the worst-case scenario.
Writes UTF8 into the given OutputStream by first writing to the given scratch array
and then writing the contents of the scratch array to the OutputStream. The given scratch byte array
is used to buffer intermediate data before it is written to the output stream.