@Test
public void testPut() {

    ByteBuffer bb1 = ByteBuffer.allocate(5);
    bb1.put("012".getBytes());
    bb1.flip();
    ByteBuffer bb2 = ByteBuffer.allocate(5);
    bb2.put("345".getBytes());
    bb2.flip();
    ByteBuffer bb3 = ByteBuffer.allocate(5);
    bb3.put("6789".getBytes());
    bb3.flip();
    IoBuffer ioBuffer = IoBuffer.newInstance();
    ioBuffer.add(bb1, bb2).add(bb3);
    byte seq[] = "abcdefghij".getBytes();
    ioBuffer.position(2);
    ioBuffer.put(seq, 3, 3);
    ioBuffer.rewind();
    byte expected[] = "01def56789".getBytes();
    for (int i = 0; i < 6; i++) {
        assertEquals(expected[i], ioBuffer.get(i));
    }
}