@Test
public void testSkip() {
System.out.println("testSkip");
ByteInputStream in = new ByteInputStream();
in.addBytes(new byte[]{43,19});
in.addBytes(new byte[]{12,15,22});
in.addBytes(new byte[]{41,11});
assertEquals(7, in.available()); assertEquals(1, in.skip(1));
assertEquals(6, in.available()); assertEquals(1, in.skip(1));
assertEquals(5, in.available()); assertEquals(1, in.skip(1));
assertEquals(4, in.available()); assertEquals(1, in.skip(1));
assertEquals(3, in.available()); assertEquals(1, in.skip(1));
assertEquals(2, in.available()); assertEquals(1, in.skip(1));
assertEquals(1, in.available()); assertEquals(1, in.skip(1));
assertEquals(0, in.available()); assertEquals(0, in.skip(1));
in.addBytes(new byte[]{43,19});
assertEquals(2, in.available()); assertEquals(43, in.read());
assertEquals(1, in.available()); assertEquals(19, in.read());
assertEquals(0, in.available()); assertEquals(-1, in.read());
in.addBytes(new byte[]{43,19});
in.addBytes(new byte[]{12,15,22});
in.addBytes(new byte[]{41,11});
assertEquals(7, in.available()); assertEquals(43, in.read());
assertEquals(6, in.available()); assertEquals(5, in.skip(5));
assertEquals(1, in.available()); assertEquals(11, in.read());
assertEquals(0, in.available()); assertEquals(-1, in.read());
}