« Berkeley DB Java Edition and Android | Main | Using Oracle Berkeley DB Java Edition as a Persistence Manager for the Google Web Toolkit »

Android vs Adler32

[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());
}
}

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on February 7, 2008 2:00 PM.

The previous post in this blog was Berkeley DB Java Edition and Android.

The next post in this blog is Using Oracle Berkeley DB Java Edition as a Persistence Manager for the Google Web Toolkit.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle