Package java.util.zip
Interface Checksum
public interface Checksum
-
Method Summary
Modifier and Type Method Description longgetValue()Returns the current calculated checksum value.voidreset()Resets the checksum value applied before beginning calculations on a new stream of data.voidupdate(byte[] buf, int off, int nbytes)Updates the checksum with the given bytes.voidupdate(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 inbufto read the bytes from.nbytes- the number of bytes to read frombuf.
-
update
void update(int val)Updates the checksum value with the given byte.- Parameters:
val- the byte to update the checksum with.
-