public void test_checksum04(){
  byte[] data=new byte[100];
  r.nextBytes(data);
  Adler32 adler32=new Adler32();
  adler32.update(data);
  final int expectedChecksum=(int)adler32.getValue();
  assertEquals(expectedChecksum,chk.checksum(ByteBuffer.wrap(data),0,data.length));
  ByteBuffer direct=ByteBuffer.allocate(data.length);
  direct.put(data);
  assertEquals(expectedChecksum,chk.checksum(direct,0,data.length));
}

public void test_checksum04 ( ) { byte [ ] data = new byte [ 100 ] ; r . nextBytes ( data ) ; Adler32 adler32 = new Adler32 ( ) ; adler32 . update ( data ) ; final int expectedChecksum = ( int ) adler32 . getValue ( ) ; assertEquals ( expectedChecksum , chk . checksum ( ByteBuffer . wrap ( data ) , 0 , data . length ) ) ; ByteBuffer direct = ByteBuffer . allocate ( data . length ) ; direct . put ( data ) ; assertEquals ( expectedChecksum , chk . checksum ( direct , 0 , data . length ) ) ; }
verify that the computed checksum is the same whether the buffer is backed by an array or not .
