Adler.update

Discussion in 'Java' started by Roedy Green, May 17, 2008.

  1. Roedy Green

    Roedy Green Guest

    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
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, May 17, 2008
    #1
    1. Advertising

  2. Roedy Green

    Arne Vajhøj Guest

    Roedy Green wrote:
    > 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
    Arne Vajhøj, May 17, 2008
    #2
    1. Advertising

  3. Roedy Green

    Roedy Green Guest

    On Fri, 16 May 2008 22:32:19 -0400, Arne Vajhøj <>
    wrote, quoted or indirectly quoted someone who said :

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


    thanks Arne. I will a note to http://mindprod.com/jgloss/adler.html
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, May 18, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hartmut Schroth
    Replies:
    3
    Views:
    3,488
    Hartmut Schroth
    Dec 1, 2003
  2. joun
    Replies:
    9
    Views:
    2,226
    W.G. Ryan eMVP
    Nov 30, 2004
  3. joun
    Replies:
    5
    Views:
    2,650
  4. =?Utf-8?B?TWljaGFlbA==?=

    How to update datagrid after update

    =?Utf-8?B?TWljaGFlbA==?=, Mar 17, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    495
    Alex D.
    Mar 17, 2006
  5. mesut
    Replies:
    0
    Views:
    652
    mesut
    Feb 19, 2007
Loading...

Share This Page