private final class AbstractNonStreamingHashFunction.BufferingHasher extends AbstractHasher
| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
BOTTOM_BYTE |
(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)
Puts an array of bytes into this sink.
|
Hasher |
putBytes(byte[] bytes,
int off,
int len)
Puts a chunk of an array of bytes into this sink.
|
Hasher |
putChar(char c)
Puts a character into this sink.
|
Hasher |
putInt(int i)
Puts an int into this sink.
|
Hasher |
putLong(long l)
Puts a long into this sink.
|
<T> Hasher |
putObject(T instance,
Funnel<? super T> funnel)
A simple convenience for
funnel.funnel(object, this). |
Hasher |
putShort(short s)
Puts a short into this sink.
|
putBoolean, putDouble, putFloat, putString, putUnencodedCharsfinal AbstractNonStreamingHashFunction.ExposedByteArrayOutputStream stream
static final int BOTTOM_BYTE
public Hasher putByte(byte b)
PrimitiveSinkb - a bytepublic Hasher putBytes(byte[] bytes)
PrimitiveSinkbytes - a byte arraypublic Hasher putBytes(byte[] bytes, int off, int len)
PrimitiveSinkbytes[off] is the first byte written,
bytes[off + len - 1] is the last.bytes - a byte arrayoff - the start offset in the arraylen - the number of bytes to writepublic Hasher putShort(short s)
PrimitiveSinkpublic Hasher putInt(int i)
PrimitiveSinkpublic Hasher putLong(long l)
PrimitiveSinkpublic Hasher putChar(char c)
PrimitiveSinkpublic <T> Hasher putObject(T instance, Funnel<? super T> funnel)
Hasherfunnel.funnel(object, this).