ByteBufferInputStream extends InputStream { @Override public long skip(long n) throws IOException { throw new IOException("skip() not supported."); } ByteBufferInputStream(ByteBuffer[] buffers); @Override int read(); @Override int read(byte[] b, int off, int len); @Override long skip(long n); @Override int available();  }
@Test(expected = IOException.class) public void requireThatSkipFails() throws IOException { ByteBuffer[] buffers = getAbcde(); ByteBufferInputStream in = new ByteBufferInputStream(buffers); in.skip(1L); }