}
@Test
public void testRewindableInputStream() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(new byte[] {0x01, 0x02, 0x03, 0x04});
RewindableInputStream ris = new RewindableInputStream(in);
byte[] buf1 = new byte[4];
byte[] buf2 = new byte[4];
ris.read(buf1);
ris.rewind();
ris.read(buf2);
for (int n = 0; n < 4; n++)
assertEquals(buf2[n], buf1[n]);
}