java.util.zip
Class Adler32

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.zip.Adler32
All Implemented Interfaces:
Checksum sample code for java.util.zip.Checksum definition code for java.util.zip.Checksum

public class Adler32
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Checksum sample code for java.util.zip.Checksum definition code for java.util.zip.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 Also:
Checksum sample code for java.util.zip.Checksum definition code for java.util.zip.Checksum

Constructor Summary
Adler32 sample code for java.util.zip.Adler32.Adler32() definition code for java.util.zip.Adler32.Adler32() ()
          Creates a new Adler32 object.
 
Method Summary
 long getValue sample code for java.util.zip.Adler32.getValue() definition code for java.util.zip.Adler32.getValue() ()
          Returns checksum value.
 void reset sample code for java.util.zip.Adler32.reset() definition code for java.util.zip.Adler32.reset() ()
          Resets checksum to initial value.
 void update sample code for java.util.zip.Adler32.update(byte[]) definition code for java.util.zip.Adler32.update(byte[]) (byte[] b)
          Updates checksum with specified array of bytes.
 void update sample code for java.util.zip.Adler32.update(byte[], int, int) definition code for java.util.zip.Adler32.update(byte[], int, int) (byte[] b, int off, int len)
          Updates checksum with specified array of bytes.
 void update sample code for java.util.zip.Adler32.update(int) definition code for java.util.zip.Adler32.update(int) (int b)
          Updates checksum with specified byte.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

Adler32 sample code for java.util.zip.Adler32() definition code for java.util.zip.Adler32()

public Adler32()
Creates a new Adler32 object.

Method Detail

update sample code for java.util.zip.Adler32.update(int) definition code for java.util.zip.Adler32.update(int)

public void update(int b)
Updates checksum with specified byte.

Specified by:
update sample code for java.util.zip.Checksum.update(int) definition code for java.util.zip.Checksum.update(int) in interface Checksum sample code for java.util.zip.Checksum definition code for java.util.zip.Checksum
Parameters:
b - an array of bytes

update sample code for java.util.zip.Adler32.update(byte[], int, int) definition code for java.util.zip.Adler32.update(byte[], int, int)

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

Specified by:
update sample code for java.util.zip.Checksum.update(byte[], int, int) definition code for java.util.zip.Checksum.update(byte[], int, int) in interface Checksum sample code for java.util.zip.Checksum definition code for java.util.zip.Checksum
Parameters:
b - the byte array to update the checksum with
off - the start offset of the data
len - the number of bytes to use for the update

update sample code for java.util.zip.Adler32.update(byte[]) definition code for java.util.zip.Adler32.update(byte[])

public void update(byte[] b)
Updates checksum with specified array of bytes.


reset sample code for java.util.zip.Adler32.reset() definition code for java.util.zip.Adler32.reset()

public void reset()
Resets checksum to initial value.

Specified by:
reset sample code for java.util.zip.Checksum.reset() definition code for java.util.zip.Checksum.reset() in interface Checksum sample code for java.util.zip.Checksum definition code for java.util.zip.Checksum

getValue sample code for java.util.zip.Adler32.getValue() definition code for java.util.zip.Adler32.getValue()

public long getValue()
Returns checksum value.

Specified by:
getValue sample code for java.util.zip.Checksum.getValue() definition code for java.util.zip.Checksum.getValue() in interface Checksum sample code for java.util.zip.Checksum definition code for java.util.zip.Checksum
Returns:
the current checksum value