SevenZipReader implements SeekableByteChannel { @Override public int write(ByteBuffer src) throws IOException { throw new NonWritableChannelException(); } SevenZipReader(final WindowReader reader); @Override int read(final ByteBuffer dst); @Override int write(ByteBuffer src); @Override long position(); @Override SeekableByteChannel position(long newPosition); @Override long size(); @Override SeekableByteChannel truncate(long size); @Override boolean isOpen(); @Override void close(); @Override String toString();  }
@Test(expected = NonWritableChannelException.class) public void testWrite() throws Exception { ByteBuffer buf = ByteBuffer.wrap(new byte[1024]); zip.write(buf); }