Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public interface

Checksum

java.util.zip.Checksum
Known Indirect Subclasses

Class Overview

The interface common to checksum classes such as Adler32 and CRC32 .

Summary

Public Methods
abstract long getValue ()
Returns the current calculated checksum value.
abstract void reset ()
Resets the checksum value applied before beginning calculations on a new stream of data.
abstract void update (byte[] buf, int off, int nbytes)
Updates the checksum with the given bytes.
abstract void update (int val)
Updates the checksum value with the given byte.

Public Methods

public abstract long getValue ()

Added in API level 1

Returns the current calculated checksum value.

Returns
  • the checksum.

public abstract void reset ()

Added in API level 1

Resets the checksum value applied before beginning calculations on a new stream of data.

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

Added in API level 1

Updates the checksum with the given bytes.

Parameters
buf the byte array from which to read the bytes.
off the initial position in buf to read the bytes from.
nbytes the number of bytes to read from buf .

public abstract void update (int val)

Added in API level 1

Updates the checksum value with the given byte.

Parameters
val the byte to update the checksum with.