FatReader implements BlockDevice { @Override public void write(long devOffset, ByteBuffer src) throws ReadOnlyException, IOException, IllegalArgumentException { ensureOpen(); throw new ReadOnlyException(); } FatReader(final WindowReader reader); @Override long getSize(); @Override void read(final long devOffset, final ByteBuffer dest); @Override void write(long devOffset, ByteBuffer src); @Override void flush(); @Override int getSectorSize(); @Override void close(); @Override boolean isClosed(); @Override String toString(); @Override boolean isReadOnly();  }
@Test(expected = ReadOnlyException.class) public void testwrite() throws Exception { ByteBuffer buffer = ByteBuffer.wrap(new byte[1024]); fat.write(21, buffer); }