@Test
public void testMark_IOExceptionInRaf() throws IOException {

  stream =
      new RandomAccessFileInputStream(tempFile, 0, testData.length) {
        @Override
        protected RandomAccessFile getRandomAccessFile(File file) throws IOException {
          return new RandomAccessFile(file, "r") {
            @Override
            public long getFilePointer() throws IOException {
              throw new IOException("Blah314159");
            }
          };
        }
      };
  try {
    stream.mark(0);
    Assert.fail("Executed code that should have failed.");
  } catch (Exception e) {
    Assert.assertEquals("Blah314159", e.getCause().getMessage());
  }
}