Hasher that handles converting primitives to bytes using a scratch ByteBuffer and streams all bytes to a sink to compute the hash.
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBuffer |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Hasher | |
| public Hasher | putBytes(byte[]
a byte array bytes)Overrides com. Implements com. |
| public Hasher | putBytes(byte[]
a byte array bytes, int the start offset in the array off, int the number of bytes to write len)Overrides com. Implements com. |
| public Hasher | putBytes(ByteBuffer
a byte buffer bytes)Overrides com. Implements com. |
| public Hasher | putChar(char c)
Overrides com. Implements com. |
| public Hasher | putInt(int i)
Overrides com. Implements com. |
| public Hasher | putLong(long l)
Overrides com. Implements com. |
| public Hasher | putShort(short s)
Overrides com. Implements com. |
| protected abstract void | |
| protected void | |
| protected void | update(byte[] b, int off, int len)
Updates this hasher with |
| protected void | |
| private Hasher |
| scratch | back to summary |
|---|---|
| private final ByteBuffer scratch | |
| AbstractByteHasher | back to summary |
|---|---|
| pack-priv AbstractByteHasher() | |
| putByte | back to summary |
|---|---|
| public Hasher putByte(byte b) Implements com. Doc from com. Puts a byte into this sink.
| |
| putBytes | back to summary |
|---|---|
| public Hasher putBytes(byte[] bytes) Overrides com. Implements com. Doc from com. Puts an array of bytes into this sink.
| |
| putBytes | back to summary |
|---|---|
| public Hasher putBytes(byte[] bytes, int off, int len) Overrides com. Implements com. Doc from com. Puts a chunk of an array of bytes into this sink.
| |
| putBytes | back to summary |
|---|---|
| public Hasher putBytes(ByteBuffer bytes) Overrides com. Implements com. Doc from com. Puts the remaining bytes of a byte buffer into this sink.
| |
| putChar | back to summary |
|---|---|
| public Hasher putChar(char c) Overrides com. Implements com. Doc from com. Puts a character into this sink.
| |
| putInt | back to summary |
|---|---|
| public Hasher putInt(int i) Overrides com. Implements com. Doc from com. Puts an int into this sink.
| |
| putLong | back to summary |
|---|---|
| public Hasher putLong(long l) Overrides com. Implements com. Doc from com. Puts a long into this sink.
| |
| putShort | back to summary |
|---|---|
| public Hasher putShort(short s) Overrides com. Implements com. Doc from com. Puts a short into this sink.
| |
| update | back to summary |
|---|---|
| protected abstract void update(byte b) Updates this hasher with the given byte. | |
| update | back to summary |
|---|---|
| protected void update(byte[] b) Updates this hasher with the given bytes. | |
| update | back to summary |
|---|---|
| protected void update(byte[] b, int off, int len) Updates this hasher with | |
| update | back to summary |
|---|---|
| protected void update(ByteBuffer b) Updates this hasher with bytes from the given buffer. | |
| update | back to summary |
|---|---|
| private Hasher update(int bytes) Updates the sink with the given number of bytes from the buffer.
| |