public void addText(CharSequence text) {
        int len = text.length();
        if (len < BUFFER_LENGTH) {
            char[] chars = text.toString().toCharArray();
            addText(chars, 0, chars.length);
            return;
        }
        int start = 0;
        while (! hasEnoughText() && start < len) {
            int end = Math.min(start + BUFFER_LENGTH, len);
            char[] chars = text.subSequence(start, end).toString().toCharArray();
            addText(chars, 0, chars.length);
            start += BUFFER_LENGTH;
        }

    }
Add <text> to the statistics being accumulated for the current
document. Note that this is a default implementation for adding
a string (not optimized)

@param text Characters to add to current statistics.
tika-core/src/main/java/org/apache/tika/language/detect/LanguageDetector.java