Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/java/util/zip/Adler32#pubctors) \| [Methods](https://developer.android.com/reference/java/util/zip/Adler32#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/util/zip/Adler32#inhmethods)

# Adler32


`
public


class
Adler32
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/java/util/zip/Checksum


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.util.zip.Adler32 |

<br />

*** ** * ** ***

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://developer.android.com/reference/java/lang/NullPointerException` to be thrown.

<br />

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/java/util/zip/Adler32#Adler32()() ` Creates a new Adler32 object. |

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

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||
| From interface ` https://developer.android.com/reference/java/util/zip/Checksum ` |---|---| | ` abstract long` | ` https://developer.android.com/reference/java/util/zip/Checksum#getValue()() ` Returns the current checksum value. | | ` abstract void` | ` https://developer.android.com/reference/java/util/zip/Checksum#reset()() ` Resets the checksum to its initial value. | | ` default void` | ` https://developer.android.com/reference/java/util/zip/Checksum#update(byte[])(byte[] b) ` Updates the current checksum with the specified array of bytes. | | ` default void` | ` https://developer.android.com/reference/java/util/zip/Checksum#update(java.nio.ByteBuffer)(https://developer.android.com/reference/java/nio/ByteBuffer buffer) ` Updates the current checksum with the bytes from the specified buffer. | | ` abstract void` | ` https://developer.android.com/reference/java/util/zip/Checksum#update(byte[],%20int,%20int)(byte[] b, int off, int len) ` Updates the current checksum with the specified array of bytes. | | ` abstract void` | ` https://developer.android.com/reference/java/util/zip/Checksum#update(int)(int b) ` Updates the current checksum with the specified byte. | ||

## Public constructors

### Adler32

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Adler32 ()
```

Creates a new Adler32 object.

<br />

## Public methods

### getValue

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getValue ()
```

Returns the checksum value.

<br />

| Returns ||
|---|---|
| `long` | the current checksum value <br /> |

### reset

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void reset ()
```

Resets the checksum to initial value.

<br />

### update

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void update (byte[] b)
```

Updates the checksum with the specified array of bytes.

<br />

| Parameters ||
|---|---|
| `b` | `byte`: the byte array to update the checksum with <br /> |

### update

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void update (ByteBuffer buffer)
```

Updates the checksum with the bytes from the specified buffer.

The checksum is updated with the remaining bytes in the buffer, starting
at the buffer's position. Upon return, the buffer's position will be
updated to its limit; its limit will not have been changed.

<br />

| Parameters ||
|---|---|
| `buffer` | `ByteBuffer`: the ByteBuffer to update the checksum with <br /> |

### update

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void update (byte[] b, 
                int off, 
                int len)
```

Updates the checksum with the specified array of bytes.

<br />

| Parameters ||
|---|---|
| `b` | `byte`: the byte array to update the checksum with <br /> |
| `off` | `int`: the start offset of the data <br /> |
| `len` | `int`: the number of bytes to use for the update <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ArrayIndexOutOfBoundsException` | if `off` is negative, or `len` is negative, or `off+len` is negative or greater than the length of the array `b`. |

### update

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void update (int b)
```

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

<br />

| Parameters ||
|---|---|
| `b` | `int`: the byte to update the checksum with <br /> |