private static Thread ignoreStream(final InputStream stream, boolean waitForDeath) {
        Thread t = new Thread(() -> {
            try {
                IOUtils.copy(stream, NullOutputStream.INSTANCE);
            } catch (IOException e) {
                //swallow
            } finally {
                IOUtils.closeQuietly(stream);
            }
        });
        t.start();
        if (waitForDeath) {
            try {
                t.join();
            } catch (InterruptedException ignore) {
            }
        }
        return t;
    }
Starts a thread that reads and discards the contents of the
standard stream of the given process. Potential exceptions
are ignored, and the stream is closed once fully processed.

@param stream       stream to sent to black hole (a k a null)
@param waitForDeath when {@code true} the caller thread will be
                    blocked till the death of new thread.
@return The thread that is created and started
tika-core/src/main/java/org/apache/tika/parser/external/ExternalParser.java