@Override
    public void characters(char[] ch, int start, int length) throws SAXException {

        if (styleDepth + scriptDepth != 0) {
            return;
        }

        try {
            writer.write(ch, start, length);
        } catch (IOException e) {
            throw new SAXException("Error writing: " + new String(ch, start, length), e);
        }
    }
Writes the given characters to the given character stream.
tika-core/src/main/java/org/apache/tika/sax/ToTextContentHandler.java