Methods Summary |
---|
public long | getValue()Returns the {@code Adler32} checksum for all input received.
return adler;
|
public void | reset()Reset this instance to its initial checksum.
adler = 1;
|
public void | update(int i)Update this {@code Adler32} checksum with the single byte provided as
argument.
adler = updateByteImpl(i, adler);
|
public void | update(byte[] buf)Update this {@code Adler32} checksum using the contents of {@code buf}.
update(buf, 0, buf.length);
|
public void | update(byte[] buf, int off, int nbytes)Update this {@code Adler32} checksum with the contents of {@code buf},
starting from the offset provided and reading n bytes of data.
// avoid int overflow, check null buf
if (off <= buf.length && nbytes >= 0 && off >= 0
&& buf.length - off >= nbytes) {
adler = updateImpl(buf, off, nbytes, adler);
} else {
throw new ArrayIndexOutOfBoundsException();
}
|
private native long | updateByteImpl(int val, long adler1)
|
private native long | updateImpl(byte[] buf, int off, int nbytes, long adler1)
|