Home All Groups
lz4-java / net / jpountz / xxhash / StreamingXXHash64.html /
net.jpountz.xxhash

Class StreamingXXHash64

  • java.lang.Object
    • net.jpountz.xxhash.StreamingXXHash64

  • public abstract class StreamingXXHash64
    extends java.lang.Object
    Streaming interface for 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.

    • Method Summary

      Methods 
      Modifier and TypeMethod and Description
      java.util.zip.ChecksumasChecksum()
      Returns a Checksum view of this instance.
      abstract longgetValue()
      Returns the value of the checksum.
      abstract voidreset()
      Resets this instance to the state it had right after instantiation.
      java.lang.StringtoString() 
      abstract voidupdate(byte[] buf, int off, int len)
      Updates the value of the hash with buf[off:off+len].
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getValue

        public abstract long getValue()
        Returns the value of the checksum.
        Returns:
        the checksum
      • update

        public abstract void update(byte[] buf,
                  int off,
                  int len)
        Updates the value of the hash with buf[off:off+len].
        Parameters:
        buf - the input data
        off - the start offset in buf
        len - the number of bytes to hash
      • reset

        public abstract void reset()
        Resets this instance to the state it had right after instantiation. The seed remains unchanged.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class  java.lang.Object
      • asChecksum

        public final java.util.zip.Checksum asChecksum()
        Returns a Checksum view of this instance. Modifications to the view will modify this instance too and vice-versa.
        Returns:
        the Checksum object representing this instance