Package com.google.common.hash
Class ChecksumHashFunction.ChecksumHasher
- java.lang.Object
-
- com.google.common.hash.AbstractHasher
-
- com.google.common.hash.AbstractByteHasher
-
- com.google.common.hash.ChecksumHashFunction.ChecksumHasher
-
- All Implemented Interfaces:
Hasher
,PrimitiveSink
- Enclosing class:
- ChecksumHashFunction
private final class ChecksumHashFunction.ChecksumHasher extends AbstractByteHasher
Hasher that updates a checksum.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.zip.Checksum
checksum
-
Constructor Summary
Constructors Modifier Constructor Description private
ChecksumHasher(java.util.zip.Checksum checksum)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HashCode
hash()
Computes a hash code based on the data that have been provided to this hasher.protected void
update(byte b)
Updates this hasher with the given byte.protected void
update(byte[] bytes, int off, int len)
Updates this hasher withlen
bytes starting atoff
in the given buffer.-
Methods inherited from class com.google.common.hash.AbstractByteHasher
putByte, putBytes, putBytes, putBytes, putChar, putInt, putLong, putShort, update, update
-
Methods inherited from class com.google.common.hash.AbstractHasher
putBoolean, putDouble, putFloat, putObject, putString, putUnencodedChars
-
-
-
-
Method Detail
-
update
protected void update(byte b)
Description copied from class:AbstractByteHasher
Updates this hasher with the given byte.- Specified by:
update
in classAbstractByteHasher
-
update
protected void update(byte[] bytes, int off, int len)
Description copied from class:AbstractByteHasher
Updates this hasher withlen
bytes starting atoff
in the given buffer.- Overrides:
update
in classAbstractByteHasher
-
-