[Update 3/11/08: Google reports
"Issue 200: Adler32 produces different results when calling
update(byte[]) vs update(byte)
http://code.google.com/p/android/issues/detail?id=200
Comment #2 by Brett.Chabot:
This issue has been fixed in the m5 release of the Android SDK.
Issue attribute updates:
Status: Released"]
In a previous post I mentioned that there was an issue with Adler32 on the Android platform that I encountered when porting JE. I have verified that this is only present in the Android JVM and not the off-the-shelf Harmony JVM.
FTR, here's the code that shows the problem:
import java.util.zip.Adler32;
import java.util.zip.Checksum;
public class Blort {
public static void main(String argv[]) {
Checksum cksum = new Adler32();
byte[] ba = new byte[] { 1, 2, 3, 4 };
cksum.update(ba, 0, 2);
cksum.update(ba, 2, 2);
System.out.println("cksum 1: " + cksum.getValue());
cksum = new Adler32();
cksum.update(ba, 0, 4);
System.out.println("cksum 2: " + cksum.getValue());
}
}