public String getText(InputStream is, Parser parser, ParseContext context, Metadata metadata)
            throws Exception {
        ContentHandler handler = new BodyContentHandler(1000000);
        try {
            parser.parse(is, handler, metadata, context);
        } finally {
            is.close();
        }
        return handler.toString();
    }
Basic text extraction.
<p>
Tries to close input stream after processing.
tika-core/src/test/java/org/apache/tika/TikaTest.java