net.anidb.checksum
Class Md5Checksum

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

public class Md5Checksum
extends Checksum

A class that can be used to compute the MD5 checksum of a data stream.

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

Constructor Summary
Md5Checksum()
          Creates a MD5 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

Md5Checksum

public Md5Checksum()
Creates a MD5 checksum object.

Method Detail

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.

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