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

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Anything related to Oracle NoSQL Database and/or Berkeley DB Java Edition.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today