private void closeStream() throws IOException {
        if (originalInputStream != inputStream) {
            // Close the byte input stream or file input stream, if either is the current one
            inputStream.close();
        }

        if (closeOriginalStreamOnClose) {
            originalInputStream.close();
        }
    }
Closes the input stream currently used for reading (may either be
the original stream or a memory or file stream after the first pass).

@throws IOException
tika-core/src/main/java/org/apache/tika/utils/RereadableInputStream.java