Top Description Inners Fields Constructors Methods
net.jpountz.xxhash

public abstract Class StreamingXXHash32

extends Object
Class Inheritance
Known Direct Subclasses
net.jpountz.xxhash.StreamingXXHash32JNI, net.jpountz.xxhash.AbstractStreamingXXHash32Java
Imports
java.util.zip.Checksum

Streaming interface for XXHash32.

This API is compatible with the block API and the following code samples are equivalent:

  int hash(XXHashFactory xxhashFactory, byte[] buf, int off, int len, int seed) {
    return xxhashFactory.hash32().hash(buf, off, len, seed);
  }
  int hash(XXHashFactory xxhashFactory, byte[] buf, int off, int len, int seed) {
    StreamingXXHash32 sh32 = xxhashFactory.newStreamingHash32(seed);
    sh32.update(buf, off, len);
    return sh32.getValue();
  }

Instances of this class are not thread-safe.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface

Field Summary

Modifier and TypeField and Description
pack-priv final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final Checksum
asChecksum()

Return a Checksum view of this instance.

public abstract int
getValue()

Get the value of the checksum.

public abstract void
reset()

Reset this instance to the state it had right after instantiation.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public abstract void
update(byte[] buf, int off, int len)

Update the value of the hash with buf[off:off+len].

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

seedback to summary
pack-priv final int seed

Constructor Detail

StreamingXXHash32back to summary
pack-priv StreamingXXHash32(int seed)

Method Detail

asChecksumback to summary
public final Checksum asChecksum()

Return a Checksum view of this instance. Modifications to the view will modify this instance too and vice-versa.

getValueback to summary
public abstract int getValue()

Get the value of the checksum.

resetback to summary
public abstract void reset()

Reset this instance to the state it had right after instantiation. The seed remains unchanged.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
updateback to summary
public abstract void update(byte[] buf, int off, int len)

Update the value of the hash with buf[off:off+len].

net.jpountz.xxhash back to summary

pack-priv Interface StreamingXXHash32.Factory

Known Direct Implementers
net.jpountz.xxhash.StreamingXXHash32JNI.Factory

Method Summary

Modifier and TypeMethod and Description
public StreamingXXHash32
newStreamingHash(int seed)

Method Detail

newStreamingHashback to summary
public StreamingXXHash32 newStreamingHash(int seed)