### Question:
ByteBufferInputStream extends InputStream { @Override public long skip(long n) throws IOException { if (n < 0L) { return 0; } n = Math.min(n, bb.remaining()); bb.position(bb.position() + (int) n); return n; } ByteBufferInputStream(ByteBuffer bb); @Override int read(); @Override int available(); @Override int read(byte[] b, int off, int len); @Override int read(byte[] b); @Override long skip(long n); static void byteBuffer2Record(ByteBuffer bb, Record record);  }### Answer:
@Test public void testSkip() throws Exception { in.read(); assertEquals(2L, in.skip(2L)); assertEquals(DATA_BYTES[3], in.read()); assertEquals(DATA_BYTES[4], in.read()); }