Package java.util.zip

Interface Checksum

All Known Implementing Classes:
Adler32, CRC32

public interface Checksum
The interface common to checksum classes such as Adler32 and CRC32.
  • Method Summary

    Modifier and Type Method Description
    long getValue()
    Returns the current calculated checksum value.
    void reset()
    Resets the checksum value applied before beginning calculations on a new stream of data.
    void update​(byte[] buf, int off, int nbytes)
    Updates the checksum with the given bytes.
    void update​(int val)
    Updates the checksum value with the given byte.
  • Method Details

    • getValue

      long getValue()
      Returns the current calculated checksum value.
      Returns:
      the checksum.
    • reset

      void reset()
      Resets the checksum value applied before beginning calculations on a new stream of data.
    • update

      void update​(byte[] buf, int off, int nbytes)
      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.
    • update

      void update​(int val)
      Updates the checksum value with the given byte.
      Parameters:
      val - the byte to update the checksum with.