public String decodeJsonLiteral() {
        // This decodes the string from UTF_8 bytes.
        StringBuilder out = new StringBuilder(len);

        boolean esc = false;
        final int end = off + len - 1;
        for (int i = off + 1; i < end; ++i) {
            char ch = fb[i];
            if (esc) {
                esc = false;

                switch (ch) {
                    case 'b':
                        out.append('\b');
                        break;
                    case 'f':
                        out.append('\f');
                        break;
                    case 'n':
                        out.append('\n');
                        break;
                    case 'r':
                        out.append('\r');
                        break;
                    case 't':
                        out.append('\t');
                        break;
                    case '\"':
                    case '\\':
                    case '/':
                        out.append(ch);
                        break;
                    case 'u':
                        int endU = i + 5;
                        if (end < endU) {
                            out.append('?');
                        } else {
                            int n = 0;
                            int pos = i + 1;
                            for (; pos < endU; ++pos) {
                                ch = fb[pos];
                                if (ch >= '0' && ch <= '9') {
                                    n = (n << 4) + (ch - '0');
                                } else if (ch >= 'a' && ch <= 'f') {
                                    n = (n << 4) + (ch - ('a' - 10));
                                } else if (ch >= 'A' && ch <= 'F') {
                                    n = (n << 4) + (ch - ('A' - 10));
                                } else {
                                    n = '?';
                                    break;
                                }
                            }
                            out.append((char) n);
                        }
                        i += 4;  // skipping 4 more characters.
                        break;
                    default:
                        out.append('?');
                        break;
                }
            } else if (ch == '\\') {
                esc = true;
            } else {
                out.append(ch);
            }
        }
        return out.toString();
    }
public String decodeJsonLiteral ( ) { StringBuilder out = new StringBuilder ( len ) ; boolean esc = false ; final int end = off + len - 1 ; for ( int i = off + 1 ; i < end ; ++ i ) { char ch = fb [ i ] ; if ( esc ) { esc = false ; switch ( ch ) { case 'b' : out . append ( '\b' ) ; break ; case 'f' : out . append ( '\f' ) ; break ; case 'n' : out . append ( '\n' ) ; break ; case 'r' : out . append ( '\r' ) ; break ; case 't' : out . append ( '\t' ) ; break ; case '\"' : case '\\' : case '/' : out . append ( ch ) ; break ; case 'u' : int endU = i + 5 ; if ( end < endU ) { out . append ( '?' ) ; } else { int n = 0 ; int pos = i + 1 ; for ( ; pos < endU ; ++ pos ) { ch = fb [ pos ] ; if ( ch >= '0' && ch <= '9' ) { n = ( n << 4 ) + ( ch - '0' ) ; } else if ( ch >= 'a' && ch <= 'f' ) { n = ( n << 4 ) + ( ch - ( 'a' - 10 ) ) ; } else if ( ch >= 'A' && ch <= 'F' ) { n = ( n << 4 ) + ( ch - ( 'A' - 10 ) ) ; } else { n = '?' ; break ; } } out . append ( ( char ) n ) ; } i += 4 ; break ; default : out . append ( '?' ) ; break ; } } else if ( ch == '\\' ) { esc = true ; } else { out . append ( ch ) ; } } return out . toString ( ) ; }
Get the whole slice as a string.

@return Slice decoded as UTF_8 string.