@Override
    public void close() throws IOException {
        if (getStandardOutput() != null) {
            getStandardOutput().close();
        }
        if (incrementalOutput != null) {
            incrementalOutput.close();
        }
    }
This will close the stream.

@throws IOException If the underlying stream throws an exception.
tika-fuzzing/src/main/java/org/apache/tika/fuzzing/pdf/EvilCOSWriter.java