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, putUnencodedChars
final AbstractNonStreamingHashFunction.ExposedByteArrayOutputStream stream
public Hasher putByte(byte b)
PrimitiveSink
b
- a bytepublic Hasher putBytes(byte[] bytes, int off, int len)
PrimitiveSink
bytes[off]
is the first byte written,
bytes[off + len - 1]
is the last.putBytes
in interface Hasher
putBytes
in interface PrimitiveSink
putBytes
in class AbstractHasher
bytes
- a byte arrayoff
- the start offset in the arraylen
- the number of bytes to writepublic Hasher putBytes(java.nio.ByteBuffer bytes)
PrimitiveSink
bytes.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 Hasher
putBytes
in interface PrimitiveSink
putBytes
in class AbstractHasher
bytes
- a byte buffer