private void checkByte(int i, SeekableInputStream in, byte[] expectedBytes) throws IOException {
    in.seek(i);
    byte result = (byte) in.read();

    assertEquals(expectedBytes[i], result);
  }
A test that skip can jump to the correct position in the stream
geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/filesystem/FileSystemJUnitTest.java