@Test(expected = IndexOutOfBoundsException.class)
public void testWriteLengthBeyondWindow() throws IOException {

  final RollingBuffer b = new RollingBuffer(newChannel(new ByteArrayInputStream(new byte[4])), 1, 2);
  b.write(Channels.newChannel(new ByteArrayOutputStream()), 0, 2);
}