4748495051525354555657
for ( int ii = 0; ii < 20; ii++ ) { buf.append( ii ); assertEquals( ii, buf.get( ii ) ); assertEquals( ii, buf.buffer()[ii] ); } assertEquals( 20, buf.capacity() ); buf.append( 20 ); assertEquals( 30, buf.capacity() );
6364656667686970717273
for ( int ii = 0; ii < 5; ii++ ) { buf.append( ii ); assertEquals( ii, buf.get( ii ) ); assertEquals( ii, buf.buffer()[ii] ); } assertEquals( 5, buf.capacity() ); buf.append( 5 ); assertEquals( 10, buf.capacity() );
8283848586878889909192
for ( int ii = 0; ii < 20; ii++ ) { buf.append( ii ); assertEquals( ii, buf.get( ii ) ); assertEquals( ii, buf.buffer()[ii] ); assertEquals( ii, buf.copyOfUsedBytes()[ii] ); } }
96979899100101102103104105
buf.append( new byte[] { 0, 1, 2, 3, 4 } ); for ( int ii = 0; ii < 5; ii++ ) { assertEquals( ii, buf.get( ii ) ); assertEquals( ii, buf.buffer()[ii] ); assertEquals( ii, buf.copyOfUsedBytes()[ii] ); } } }