int offset = random.nextInt(b.length);
int len = b.length - offset;
b1 = ByteBuffer.wrap(b, offset, len);
buffer = ByteBufferBuffer.wrap(b1);
assertEquals(b1.position(), buffer.position());
assertEquals(b1.limit(), buffer.limit());
assertEquals(b1.capacity(), buffer.capacity());
assertEquals(b1.remaining(), buffer.remaining());
while (b1.hasRemaining()) {
assertEquals(b1.get(), buffer.get());
}