java.util.zip
Class CRC32

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

public class CRC32
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 CRC-32 of a data stream.

See Also:
Checksum sample code for java.util.zip.Checksum definition code for java.util.zip.Checksum

Constructor Summary
CRC32 sample code for java.util.zip.CRC32.CRC32() definition code for java.util.zip.CRC32.CRC32() ()
          Creates a new CRC32 object.
 
Method Summary
 long getValue sample code for java.util.zip.CRC32.getValue() definition code for java.util.zip.CRC32.getValue() ()
          Returns CRC-32 value.
 void reset sample code for java.util.zip.CRC32.reset() definition code for java.util.zip.CRC32.reset() ()
          Resets CRC-32 to initial value.
 void update sample code for java.util.zip.CRC32.update(byte[]) definition code for java.util.zip.CRC32.update(byte[]) (byte[] b)
          Updates checksum with specified array of bytes.
 void update sample code for java.util.zip.CRC32.update(byte[], int, int) definition code for java.util.zip.CRC32.update(byte[], int, int) (byte[] b, int off, int len)
          Updates CRC-32 with specified array of bytes.
 void update sample code for java.util.zip.CRC32.update(int) definition code for java.util.zip.CRC32.update(int) (int b)
          Updates CRC-32 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

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

public CRC32()
Creates a new CRC32 object.

Method Detail

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

public void update(int b)
Updates CRC-32 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 - the byte to update the checksum with

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

public void update(byte[] b,
                   int off,
                   int len)
Updates CRC-32 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.CRC32.update(byte[]) definition code for java.util.zip.CRC32.update(byte[])

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

Parameters:
b - the array of bytes to update the checksum with

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

public void reset()
Resets CRC-32 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.CRC32.getValue() definition code for java.util.zip.CRC32.getValue()

public long getValue()
Returns CRC-32 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