ByteArrayFileInputStream extends InputStream { @Override public void mark(int readLimit) { _markIndex = _index; } ByteArrayFileInputStream(File file, int threshold);  ByteArrayFileInputStream(
		File file, int threshold, boolean deleteOnClose); @Override int available(); @Override void close(); File getFile(); @Override void mark(int readLimit); @Override boolean markSupported(); @Override int read(); @Override int read(byte[] bytes); @Override int read(byte[] bytes, int offset, int length); @Override void reset(); @Override long skip(long skip);  }
@Test public void testMark() throws IOException { ByteArrayFileInputStream byteArrayFileInputStream = new ByteArrayFileInputStream(_testFile, 2048); Assert.assertTrue(byteArrayFileInputStream.markSupported()); for (int i = 0; i < 512; i++) { Assert.assertEquals(i & 0xff, byteArrayFileInputStream.read()); } byteArrayFileInputStream.mark(0); for (int i = 512; i < 1024; i++) { Assert.assertEquals(i & 0xff, byteArrayFileInputStream.read()); } Assert.assertEquals(-1, byteArrayFileInputStream.read()); byteArrayFileInputStream.reset(); for (int i = 512; i < 1024; i++) { Assert.assertEquals(i & 0xff, byteArrayFileInputStream.read()); } byteArrayFileInputStream.close(); byteArrayFileInputStream = new ByteArrayFileInputStream(_testFile, 512); Assert.assertFalse(byteArrayFileInputStream.markSupported()); for (int i = 0; i < 1024; i++) { Assert.assertEquals(i & 0xff, byteArrayFileInputStream.read()); } Assert.assertEquals(-1, byteArrayFileInputStream.read()); byteArrayFileInputStream.reset(); byteArrayFileInputStream.reset(); for (int i = 0; i < 1024; i++) { Assert.assertEquals(i & 0xff, byteArrayFileInputStream.read()); } byteArrayFileInputStream.close(); }