public void test_checksum02(){
  byte[] data=new byte[100];
  r.nextBytes(data);
  Adler32 adler32=new Adler32();
  adler32.update(data,10,90);
  final int expectedChecksum=(int)adler32.getValue();
  assertEquals(expectedChecksum,chk.checksum(ByteBuffer.wrap(data),10,data.length));
}

public void test_checksum02 ( ) { byte [ ] data = new byte [ 100 ] ; r . nextBytes ( data ) ; Adler32 adler32 = new Adler32 ( ) ; adler32 . update ( data , 10 , 90 ) ; final int expectedChecksum = ( int ) adler32 . getValue ( ) ; assertEquals ( expectedChecksum , chk . checksum ( ByteBuffer . wrap ( data ) , 10 , data . length ) ) ; }
test verifies that only the specified region of the buffer is used to compute the checksum .
