public class

Adler32

extends Object
implements Checksum
java.lang.Object
   ↳ java.util.zip.Adler32

Class Overview

The Adler-32 class is used to compute the Adler32 checksum from a set of data. Compared to the CRC-32 algorithm it trades reliabilty for speed. Refer to RFC 1950 for the specification.

See Also

Summary

Public Constructors
Adler32()
Public Methods
long getValue()
Returns the Adler32 checksum for all input received.
void reset()
Reset this instance to its initial checksum.
void update(byte[] buf, int off, int nbytes)
Update this Adler32 checksum with the contents of buf, starting from the offset provided and reading n bytes of data.
void update(int i)
Update this Adler32 checksum with the single byte provided as argument.
void update(byte[] buf)
Update this Adler32 checksum using the contents of buf.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.util.zip.Checksum

Public Constructors

public Adler32 ()

Since: API Level 1

Public Methods

public long getValue ()

Since: API Level 1

Returns the Adler32 checksum for all input received.

Returns
  • The checksum for this instance.

public void reset ()

Since: API Level 1

Reset this instance to its initial checksum.

public void update (byte[] buf, int off, int nbytes)

Since: API Level 1

Update this Adler32 checksum with the contents of buf, starting from the offset provided and reading n bytes of data.

Parameters
buf buffer to obtain data from.
off offset in buf to start reading from.
nbytes number of bytes from buf to use.
Throws
ArrayIndexOutOfBoundsException if offset > buf.length or nbytes is negative or offset + nbytes > buf.length.

public void update (int i)

Since: API Level 1

Update this Adler32 checksum with the single byte provided as argument.

Parameters
i the byte to update checksum with.

public void update (byte[] buf)

Since: API Level 1

Update this Adler32 checksum using the contents of buf.

Parameters
buf bytes to update checksum with.