net.anidb.checksum
Class Crc32Checksum

java.lang.Object
  extended by net.anidb.checksum.Checksum
      extended by net.anidb.checksum.Crc32Checksum

public class Crc32Checksum
extends Checksum

A CRC32 checksum.

Version:
1.0, 03.01.2010
Author:
grizzlyxp (http://anidb.net/perl-bin/animedb.pl?show=userpage&uid=63935)

Constructor Summary
Crc32Checksum()
          Creates a CRC32 checksum object.
 
Method Summary
 byte[] getDigest()
          Builds and returns the digest.
 void reset()
          Resets the checksum object.
 void update(byte[] buf, int off, int len)
          Updates the checksum with data.
 void update(int data)
          Updates the checksum with data.
 
Methods inherited from class net.anidb.checksum.Checksum
getHexDigest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Crc32Checksum

public Crc32Checksum()
Creates a CRC32 checksum object.

Method Detail

getDigest

public byte[] getDigest()
Description copied from class: Checksum

Builds and returns the digest.

After calling this method you have to use Checksum.reset().

Specified by:
getDigest in class Checksum
Returns:
The digest.
See Also:
Checksum.reset(), Checksum.getHexDigest()

reset

public void reset()
Description copied from class: Checksum
Resets the checksum object.

Specified by:
reset in class Checksum

update

public void update(byte[] buf,
                   int off,
                   int len)
Description copied from class: Checksum
Updates the checksum with data.

Specified by:
update in class Checksum
Parameters:
buf - The data buffer.
off - The offset.
len - The length.

update

public void update(int data)
Description copied from class: Checksum
Updates the checksum with data.

Specified by:
update in class Checksum
Parameters:
data - The data.