private void handleText(int length, InputStream stream, XHTMLContentHandler xhtml)
            throws IOException, SAXException, TikaException {
        byte[] str = new byte[length];
        IOUtils.readFully(stream, str);
        if (str[length - 1] != 0) {
            // Not properly null terminated, must be wrong
            return;
        }

        String text = extractText(str, false);

        xhtml.startElement("p");
        xhtml.characters(text);
        xhtml.endElement("p");
    }
How long do we allow a text run to claim to be, before we
decide we're confused and it's not really text after all?
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-cad-module/src/main/java/org/apache/tika/parser/prt/PRTParser.java