public void test_getPutByteArray(){
  final int size=200;
  final IDataRecord buf=new FixedByteArrayBuffer(size);
  assertEquals((byte)0,buf.getByte(0));
  assertEquals((byte)0,buf.getByte(size - 1));
  final int pos=1;
  for (int i=0; i < LIMIT; i++) {
    final byte[] expected=new byte[r.nextInt(size - 2)];
    r.nextBytes(expected);
    buf.put(pos,expected);
    assertEquals(0,BytesUtil.compareBytesWithLenAndOffset(0,expected.length,expected,pos,expected.length,buf.array()));
    final byte[] actual=new byte[expected.length];
    buf.get(pos,actual);
    assertTrue(BytesUtil.bytesEqual(expected,actual));
  }
  assertEquals((byte)0,buf.getByte(0));
  assertEquals((byte)0,buf.getByte(pos + size - 2));
}

public void test_getPutByteArray ( ) { final int size = 200 ; final IDataRecord buf = new FixedByteArrayBuffer ( size ) ; assertEquals ( ( byte ) 0 , buf . getByte ( 0 ) ) ; assertEquals ( ( byte ) 0 , buf . getByte ( size - 1 ) ) ; final int pos = 1 ; for ( int i = 0 ; i < LIMIT ; i ++ ) { final byte [ ] expected = new byte [ r . nextInt ( size - 2 ) ] ; r . nextBytes ( expected ) ; buf . put ( pos , expected ) ; assertEquals ( 0 , BytesUtil . compareBytesWithLenAndOffset ( 0 , expected . length , expected , pos , expected . length , buf . array ( ) ) ) ; final byte [ ] actual = new byte [ expected . length ] ; buf . get ( pos , actual ) ; assertTrue ( BytesUtil . bytesEqual ( expected , actual ) ) ; } assertEquals ( ( byte ) 0 , buf . getByte ( 0 ) ) ; assertEquals ( ( byte ) 0 , buf . getByte ( pos + size - 2 ) ) ; }
test of the simple forms of the bulk get / put methods .
