Since: API Level 1
public interface

Checksum

java.util.zip.Checksum
Known Indirect Subclasses

Class Overview

Holds information about a checksum which was computed with the methods implementing a checksum algorithm.

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 ()

Since: API Level 1

Returns the current calculated checksum value.

Returns
  • the checksum.

public abstract void reset ()

Since: 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)

Since: 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)

Since: API Level 1

Updates the checksum value with the given byte.

Parameters
val the byte to update the checksum with.