Adler.update

R

Roedy Green

I have put is a bug report on Adler.update( int ).

The JavaDoc in the source code is self-contradictory.

Has anyone experimented to find out what it really does?

e.g.
1. just takes the low order byte.
2. processes 4 bytes most to least significant
3. processes 4 bytes least to most significant
 
A

Arne Vajhøj

Roedy said:
I have put is a bug report on Adler.update( int ).

The JavaDoc in the source code is self-contradictory.

Has anyone experimented to find out what it really does?

e.g.
1. just takes the low order byte.
2. processes 4 bytes most to least significant
3. processes 4 bytes least to most significant

The only think that makes sense is that it is 1 byte.

But no need to guess. SUN Java is open source now.

The code eventually ends up in:

JNIEXPORT jint JNICALL
Java_java_util_zip_Adler32_update(JNIEnv *env, jclass cls, jint adler,
jint b)
{
Bytef buf[1];

buf[0] = (Bytef)b;
return adler32(adler, buf, 1);
}

and Bytef is an unsigned char.

So the correct answer is #1.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top