# Adler32

public class **Adler32** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
implements [Checksum](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Checksum.html) A class that can be used to compute the Adler-32 checksum of a data
stream. An Adler-32 checksum is almost as reliable as a CRC-32 but
can be computed much faster.

Passing a `null` argument to a method in this class will cause
a `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html` to be thrown.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Checksum.html`

### Public Constructor Summary

|---|---|
|   | [Adler32](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Adler32.html#Adler32())() Creates a new Adler32 object. |

### Public Method Summary

|---|---|
| long | [getValue](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Adler32.html#getValue())() Returns the checksum value. |
| void | [reset](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Adler32.html#reset())() Resets the checksum to initial value. |
| void | [update](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Adler32.html#update(byte[]))(byte\[\] b) Updates the checksum with the specified array of bytes. |
| void | [update](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Adler32.html#update(java.nio.ByteBuffer))([ByteBuffer](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ByteBuffer.html) buffer) Updates the checksum with the bytes from the specified buffer. |
| void | [update](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Adler32.html#update(byte[],%20int,%20int))(byte\[\] b, int off, int len) Updates the checksum with the specified array of bytes. |
| void | [update](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Adler32.html#update(int))(int b) Updates the checksum with the specified byte (the low eight bits of the argument b). |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [java.util.zip.Checksum](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Checksum.html)

|---|---|
| abstract long | [getValue](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Checksum.html#getValue())() Returns the current checksum value. |
| abstract void | [reset](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Checksum.html#reset())() Resets the checksum to its initial value. |
| abstract void | [update](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Checksum.html#update(byte[],%20int,%20int))(byte\[\] b, int off, int len) Updates the current checksum with the specified array of bytes. |
| abstract void | [update](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Checksum.html#update(int))(int b) Updates the current checksum with the specified byte. |

## Public Constructors

#### public
**Adler32**
()

Creates a new Adler32 object.

## Public Methods

#### public long
**getValue**
()

Returns the checksum value.

##### Returns

- the current checksum value

#### public void
**reset**
()

Resets the checksum to initial value.

#### public void
**update**
(byte\[\] b)

Updates the checksum with the specified array of bytes.

##### Parameters

| b | the byte array to update the checksum with |
|---|---|

#### public void
**update**
([ByteBuffer](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ByteBuffer.html) buffer)

Updates the checksum with the bytes from the specified buffer.

The checksum is updated using
buffer.`https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/Buffer.html#remaining()`
bytes starting at
buffer.`https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/Buffer.html#position()`
Upon return, the buffer's position will be updated to its
limit; its limit will not have been changed.

##### Parameters

| buffer | the ByteBuffer to update the checksum with |
|---|---|

#### public void
**update**
(byte\[\] b, int off, int len)

Updates the checksum with the specified array of bytes.

##### Parameters

| b | the byte array to update the checksum with |
| off | the start offset of the data |
| len | the number of bytes to use for the update |
|---|---|

##### Throws

| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | if `off` is negative, or `len` is negative, or `off+len` is greater than the length of the array `b` |
|---|---|

#### public void
**update**
(int b)

Updates the checksum with the specified byte (the low eight
bits of the argument b).

##### Parameters

| b | the byte to update the checksum with |
|---|---|