FileDocCategorySizeDatePackage
Adler32.javaAPI DocJava SE 5 API1649Fri Aug 26 14:57:28 BST 2005java.util.zip

Adler32

public class Adler32 extends Object implements Checksum
A class that can be used to compute the Adler-32 checksum of a data stream. An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed much faster.
see
Checksum
version
1.29, 08/09/05
author
David Connelly

Fields Summary
private int
adler
Constructors Summary
public Adler32()
Creates a new Adler32 object.


              
      
    
Methods Summary
public longgetValue()
Returns checksum value.

	return (long)adler & 0xffffffffL;
    
public voidreset()
Resets checksum to initial value.

	adler = 1;
    
public voidupdate(int b)
Updates checksum with specified byte.

param
b an array of bytes

	adler = update(adler, b);
    
public voidupdate(byte[] b, int off, int len)
Updates checksum with specified array of bytes.

	if (b == null) {
	    throw new NullPointerException();
	}
        if (off < 0 || len < 0 || off > b.length - len) {
	    throw new ArrayIndexOutOfBoundsException();
	}
	adler = updateBytes(adler, b, off, len);
    
public voidupdate(byte[] b)
Updates checksum with specified array of bytes.

	adler = updateBytes(adler, b, 0, b.length);
    
private static native intupdate(int adler, int b)

private static native intupdateBytes(int adler, byte[] b, int off, int len)