org.biojavax.utils
Class CRC64Checksum

java.lang.Object
  extended by org.biojavax.utils.CRC64Checksum
All Implemented Interfaces:
Checksum

public class CRC64Checksum
extends Object
implements Checksum

Utility class that calculates a CRC64 checksum on a stream of bytes. Code was based on some from BioPerl. Note that we use longs then cast them to avoid the lack of an unsigned int in Java. Longs are 64-bit but we are only using the bottom 32 bits. An int is 32-bit but encodes sign so we can get amusing results if we don't allow for this.

Since:
1.5
Author:
Unknown. Copied from Expasy4J for convenience. See http://dev.isb-sib.ch/projects/expasy4j/

Constructor Summary
CRC64Checksum()
           
 
Method Summary
 long getValue()
           
 void reset()
           
 String toString()
          Returns a zero-padded 16 character wide string containing the current value of this checksum in uppercase hexadecimal format.
 void update(byte[] b, int offset, int length)
           
 void update(int b)
           
 void update(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CRC64Checksum

public CRC64Checksum()
Method Detail

update

public void update(int b)
Specified by:
update in interface Checksum

update

public void update(byte[] b,
                   int offset,
                   int length)
Specified by:
update in interface Checksum

update

public void update(String s)

getValue

public long getValue()
Specified by:
getValue in interface Checksum

toString

public String toString()
Returns a zero-padded 16 character wide string containing the current value of this checksum in uppercase hexadecimal format.

Overrides:
toString in class Object

reset

public void reset()
Specified by:
reset in interface Checksum