@Test(expectedExceptions = IOException.class)
public void truncate() throws IOException {

    ByteBuffer original = ByteBuffer.wrap(new byte[]{0x1, 0x2, 0x3, 0x4});
    SeekableByteChannel channel = new ByteBufferSeekableByteChannel(original);
    channel.truncate(0);
}