private final class AbstractNonStreamingHashFunction.BufferingHasher extends AbstractHasher
| Modifier and Type | Field and Description |
|---|---|
(package private) AbstractNonStreamingHashFunction.ExposedByteArrayOutputStream |
stream |
| Constructor and Description |
|---|
BufferingHasher(int expectedInputSize) |
| Modifier and Type | Method and Description |
|---|---|
HashCode |
hash()
Computes a hash code based on the data that have been provided to this hasher.
|
Hasher |
putByte(byte b)
Puts a byte into this sink.
|
Hasher |
putBytes(byte[] bytes,
int off,
int len)
Puts a chunk of an array of bytes into this sink.
|
Hasher |
putBytes(java.nio.ByteBuffer bytes)
Puts the remaining bytes of a byte buffer into this sink.
|
putBoolean, putBytes, putChar, putDouble, putFloat, putInt, putLong, putObject, putShort, putString, putUnencodedCharsfinal AbstractNonStreamingHashFunction.ExposedByteArrayOutputStream stream
public Hasher putByte(byte b)
PrimitiveSinkb - a bytepublic Hasher putBytes(byte[] bytes, int off, int len)
PrimitiveSinkbytes[off] is the first byte written,
bytes[off + len - 1] is the last.putBytes in interface HasherputBytes in interface PrimitiveSinkputBytes in class AbstractHasherbytes - a byte arrayoff - the start offset in the arraylen - the number of bytes to writepublic Hasher putBytes(java.nio.ByteBuffer bytes)
PrimitiveSinkbytes.position() is the first
byte written, bytes.limit() - 1 is the last. The position of the buffer will be equal
to the limit when this method returns.putBytes in interface HasherputBytes in interface PrimitiveSinkputBytes in class AbstractHasherbytes - a byte buffer