private void escapeAndAppendString(char[] buf, int start, int len) throws IOException {
        final char NE = (char) ESCAPE_TABLE.length;
        final String[] escapes = ESCAPE_TABLE;
        int end = start + len;
        int lastPos = start;
        int pos;
        for (pos = start; pos < end; pos++) {
            char c = buf[pos];
            if (c >= NE) continue;
            String escape = escapes[c];
            if (escape == null) continue;
            if (lastPos < pos) append(buf, lastPos, pos - lastPos);
            lastPos = pos + 1;
            append(escape);
        }
        if (lastPos < pos) append(buf, lastPos, pos - lastPos);
    }
Allocate a FastXmlSerializer with the given internal output buffer size.  If the
size is zero or negative, then the default buffer size will be used.

@param bufferSize Size in bytes of the in-memory output buffer that the writer will use.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/FastXmlSerializer.java