Package org.biojavax.utils
Class CRC64Checksum
- java.lang.Object
-
- org.biojavax.utils.CRC64Checksum
-
- All Implemented Interfaces:
java.util.zip.Checksum
public class CRC64Checksum extends java.lang.Object implements java.util.zip.ChecksumUtility 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
Constructors Constructor Description CRC64Checksum()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetValue()voidreset()java.lang.StringtoString()Returns a zero-padded 16 character wide string containing the current value of this checksum in uppercase hexadecimal format.voidupdate(byte[] b, int offset, int length)voidupdate(int b)voidupdate(java.lang.String s)
-
-
-
Method Detail
-
update
public void update(int b)
- Specified by:
updatein interfacejava.util.zip.Checksum
-
update
public void update(byte[] b, int offset, int length)- Specified by:
updatein interfacejava.util.zip.Checksum
-
update
public void update(java.lang.String s)
-
getValue
public long getValue()
- Specified by:
getValuein interfacejava.util.zip.Checksum
-
toString
public java.lang.String toString()
Returns a zero-padded 16 character wide string containing the current value of this checksum in uppercase hexadecimal format.- Overrides:
toStringin classjava.lang.Object
-
reset
public void reset()
- Specified by:
resetin interfacejava.util.zip.Checksum
-
-