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, putUnencodedChars
final AbstractNonStreamingHashFunction.ExposedByteArrayOutputStream stream
static final int BOTTOM_BYTE
public Hasher putByte(byte b)
PrimitiveSink
b
- a bytepublic Hasher putBytes(byte[] bytes)
PrimitiveSink
bytes
- a byte arraypublic Hasher putBytes(byte[] bytes, int off, int len)
PrimitiveSink
bytes[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)
PrimitiveSink
public Hasher putInt(int i)
PrimitiveSink
public Hasher putLong(long l)
PrimitiveSink
public Hasher putChar(char c)
PrimitiveSink
public <T> Hasher putObject(T instance, Funnel<? super T> funnel)
Hasher
funnel.funnel(object, this)
.