public void run() {
            try {
                ContentHandler handler = new BodyContentHandler(writer);
                parser.parse(stream, handler, metadata, context);
            } catch (Throwable t) {
                throwable = t;
            }

            try {
                stream.close();
            } catch (Throwable t) {
                if (throwable == null) {
                    throwable = t;
                }
            }

            try {
                writer.close();
            } catch (Throwable t) {
                if (throwable == null) {
                    throwable = t;
                }
            }
        }
Parses the given binary stream and writes the text content
to the write end of the pipe. Potential exceptions (including
the one caused if the read end is closed unexpectedly) are
stored before the input stream is closed and processing is stopped.
tika-core/src/main/java/org/apache/tika/parser/ParsingReader.java