public abstract class StreamingXXHash64
extends java.lang.Object
implements java.io.Closeable
XXHash64.
This API is compatible with the block API and the following
code samples are equivalent:
long hash(XXHashFactory xxhashFactory, byte[] buf, int off, int len, long seed) {
return xxhashFactory.hash64().hash(buf, off, len, seed);
}
long hash(XXHashFactory xxhashFactory, byte[] buf, int off, int len, long seed) {
StreamingXXHash64 sh64 = xxhashFactory.newStreamingHash64(seed);
sh64.update(buf, off, len);
return sh64.getValue();
}
Instances of this class are not thread-safe.
| Modifier and Type | Method and Description |
|---|---|
java.util.zip.Checksum |
asChecksum()
Returns a
Checksum view of this instance. |
void |
close()
Releases any system resources associated with this instance.
|
abstract long |
getValue()
Returns the value of the checksum.
|
abstract void |
reset()
Resets this instance to the state it had right after instantiation.
|
java.lang.String |
toString() |
abstract void |
update(byte[] buf,
int off,
int len)
Updates the value of the hash with buf[off:off+len].
|
public abstract long getValue()
public abstract void update(byte[] buf,
int off,
int len)
buf - the input dataoff - the start offset in buflen - the number of bytes to hashpublic abstract void reset()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic java.lang.String toString()
toString in class java.lang.Objectpublic final java.util.zip.Checksum asChecksum()
Checksum view of this instance. Modifications to the view
will modify this instance too and vice-versa.Checksum object representing this instance