Android Utililty Methods UTF8 to String Convert

List of utility methods to do UTF8 to String Convert

Description

The list of methods to do UTF8 to String Convert are organized into topic(s).

Method

Stringutf8BytesToString(byte[] bytes, int start, int length)
Converts an array of UTF-8 bytes into a string.
char[] chars = localBuffer.get();
if (chars == null || chars.length < length) {
    chars = new char[length];
    localBuffer.set(chars);
int outAt = 0;
for (int at = start; length > 0; ) {
    int v0 = bytes[at] & 0xFF;
...
Stringutf8BytesWithUtf16LengthToString( @Nonnull byte[] bytes, int start, int utf16Length)
Converts an array of UTF-8 bytes into a string.
return utf8BytesWithUtf16LengthToString(bytes, start, utf16Length,
        null);
Stringutf8BytesWithUtf16LengthToString( @Nonnull byte[] bytes, int start, int utf16Length, @Nullable int[] readLength)
Converts an array of UTF-8 bytes into a string.
char[] chars = localBuffer.get();
if (chars == null || chars.length < utf16Length) {
    chars = new char[utf16Length];
    localBuffer.set(chars);
int outAt = 0;
int at = 0;
for (at = start; utf16Length > 0; utf16Length--) {
...
Stringutf8decoder(byte[] data, int offset, int length)
utfdecoder
try {
    return UTF8_DECODER.decode(
            ByteBuffer.wrap(data, offset, length)).toString();
} catch (CharacterCodingException ex) {
    throw new RuntimeException(ex);