private Path createTestFile(int testSize) throws IOException {
        Path testfile = Files.createTempFile(tempDir, "TIKA_ris_test", ".tmp");
        try (OutputStream fos = Files.newOutputStream(testfile)) {
            for (int i = 0; i < testSize; i++) {
                fos.write(i);
            }
        }
        return testfile;
    }
Read increasingly more of the stream, but not all, with each pass before rewinding to
make sure we pick up at the correct point
tika-core/src/test/java/org/apache/tika/TestRereadableInputStream.java