  @Test
  public void testReadByteArray() throws IOException {

    bi.reset();

    byte[] r = new byte[100];
    assertEquals(buf.length, ci.read(r));

    for (int i = 0; i < buf.length; i++)
      assertEquals(buf[i], r[i]);

    assertEquals(-1, ci.read());

    bi.reset();
    r = new byte[0];
    assertEquals(0, ci.read(r));
  }