Package java.util.zip
Class Adler32
java.lang.Object
java.util.zip.Adler32
- All Implemented Interfaces:
Checksum
public class Adler32 extends Object implements Checksum
The Adler-32 class is used to compute the
Adler32 checksum from a set
of data. Compared to CRC32 it trades reliability for speed.
Refer to RFC 1950 for the specification.-
Constructor Summary
Constructors Constructor Description Adler32() -
Method Summary
Modifier and Type Method Description longgetValue()Returns theAdler32checksum for all input received.voidreset()Reset this instance to its initial checksum.voidupdate(byte[] buf)Update thisAdler32checksum using the contents ofbuf.voidupdate(byte[] buf, int offset, int byteCount)Update thisAdler32checksum with the contents ofbuf, starting fromoffsetand readingbyteCountbytes of data.voidupdate(int i)Update thisAdler32checksum with the single byte provided as argument.
-
Constructor Details
-
Adler32
public Adler32()
-
-
Method Details
-
getValue
public long getValue()Returns theAdler32checksum for all input received. -
reset
public void reset()Reset this instance to its initial checksum. -
update
public void update(int i)Update thisAdler32checksum with the single byte provided as argument. -
update
public void update(byte[] buf)Update thisAdler32checksum using the contents ofbuf.- Parameters:
buf- bytes to update checksum with.
-
update
public void update(byte[] buf, int offset, int byteCount)Update thisAdler32checksum with the contents ofbuf, starting fromoffsetand readingbyteCountbytes of data.
-