### Question:
RepeatableFileInputStream extends SdkInputStream { @Override public int read() throws IOException { abortIfNeeded(); int byteRead = fis.read(); if (byteRead != -1) { bytesReadPastMarkPoint++; return byteRead; } else { return -1; } } RepeatableFileInputStream(File file); File getFile(); @Override void reset(); @Override boolean markSupported(); @Override void mark(int readlimit); @Override int available(); @Override void close(); @Override int read(); @Override long skip(long n); @Override int read(byte[] arg0, int arg1, int arg2); @Override InputStream getWrappedInputStream();  }### Answer:
@Test public void testRead() throws IOException { File tmp = File.createTempFile("test" + new Date(), null); try { FileWriter writer = new FileWriter(tmp); writer.write("content"); writer.close(); RepeatableFileInputStream rfis = new RepeatableFileInputStream(tmp); try { ByteArrayOutputStream read = new ByteArrayOutputStream(); int curr = -1; while ((curr = rfis.read()) != -1) { read.write(curr); } read.flush(); assertEquals(rfis.getWrappedInputStream().read(), -1); assertEquals(read.toString(), "content"); assertSame(rfis.getFile(), tmp); } finally { rfis.close(); } } finally { tmp.delete(); } }