private void append(String str, int i, final int length) throws IOException {
        if (length > mBufferLen) {
            final int end = i + length;
            while (i < end) {
                int next = i + mBufferLen;
                append(str, i, next < end ? mBufferLen : (end - i));
                i = next;
            }
            return;
        }
        int pos = mPos;
        if ((pos + length) > mBufferLen) {
            flush();
            pos = mPos;
        }
        str.getChars(i, i + length, mText, pos);
        mPos = pos + length;
    }
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