protected void encodeSTRING(String value) {
            // Batching up some chars before calling out.append() is 20-60% faster depending on string size
            char[] buf = new char[128];
            char pos = 0;

            buf[pos++] = '"';

            for (char c : value.toCharArray()) {
                if(pos > buf.length - 8) {
                    out.append(buf, 0, pos);
                    pos = 0;
                }
                switch (c) {
                case '"':  buf[pos++] ='\\';buf[pos++] ='"'; break;
                case '\\': buf[pos++] ='\\';buf[pos++] ='\\'; break;
                case '\b': buf[pos++] ='\\';buf[pos++] ='b'; break;
                case '\f': buf[pos++] ='\\';buf[pos++] ='f'; break;
                case '\n': buf[pos++] ='\\';buf[pos++] ='n'; break;
                case '\r': buf[pos++] ='\\';buf[pos++] ='r'; break;
                case '\t': buf[pos++] ='\\';buf[pos++] ='t'; break;
                default:
                    if (c > 0x1f) {
                        buf[pos++] =c;
                    } else { // requires escaping according to RFC 4627
                        buf[pos++] ='\\'; buf[pos++] ='u';
                        buf[pos++] =hex[(c >> 12) & 0xf];
                        buf[pos++] =hex[(c >> 8) & 0xf];
                        buf[pos++] =hex[(c >> 4) & 0xf];
                        buf[pos++] =hex[c & 0xf];
                    }
                }
            }
            buf[pos++] ='"';

            out.append(buf, 0, pos);
        }
Renders the given value to the target stringbuilder with a given encoder.
This is useful to use an encoder where rendering of some value types is customized.
vespajlib/src/main/java/com/yahoo/data/access/simple/JsonRender.java