public void rewind() throws IOException {
        if (closed) {
            throw new IOException("Stream is already closed");
        }

        if (storeOutputStream != null) {
            storeOutputStream.close();
            storeOutputStream = null;
        }

        // Close the byte input stream or file input stream
        if (inputStream != originalInputStream) {
            inputStream.close();
        }

        bufferHighWaterMark = Math.max(bufferPointer, bufferHighWaterMark);
        bufferPointer = bufferHighWaterMark;

        if (bufferHighWaterMark > 0) {
            // If we have a buffer, then we'll read from it
            if (byteBuffer != null) {
                readingFromBuffer = true;
                inputStream = UnsynchronizedByteArrayInputStream.builder().
                        setByteArray(byteBuffer).setOffset(0).setLength(bufferHighWaterMark).get();
            } else {
                // No buffer, which means we've switched to a file
                inputStream = new BufferedInputStream(new FileInputStream(storeFile));
            }
        } else {
            inputStream = originalInputStream;
        }
    }
"Rewinds" the stream to the beginning for rereading.

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