private void handleNoteText(InputStream stream, XHTMLContentHandler xhtml)
            throws IOException, SAXException, TikaException {
        // Ensure we have the right padding text
        int read;
        for (int i = 0; i < 10; i++) {
            read = stream.read();
            if (read >= 0 && read <= 0x0f) {
                // Promising
            } else {
                // Wrong, false detection
                return;
            }
        }
        read = stream.read();
        if (read != 0x1f) {
            // Wrong, false detection
            return;
        }

        int length = EndianUtils.readUShortLE(stream);
        if (length <= MAX_TEXT_LENGTH) {
            // Length check passed
            handleText(length, stream, xhtml);
        }
    }
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