@Test
public void testMark() throws IOException {

	// byte[]
	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());
	// In memory reset to index 512
	byteArrayFileInputStream.reset();
	for (int i = 512; i < 1024; i++) {
		Assert.assertEquals(i & 0xff, byteArrayFileInputStream.read());
	}
	byteArrayFileInputStream.close();
	// FileInputStream
	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());
	// FileInputStream reset to index 0
	byteArrayFileInputStream.reset();
	// Calling reset twice does not cause a NullPointerException
	byteArrayFileInputStream.reset();
	for (int i = 0; i < 1024; i++) {
		Assert.assertEquals(i & 0xff, byteArrayFileInputStream.read());
	}
	byteArrayFileInputStream.close();
}