Top Description Inners Fields Constructors Methods
org.lwjgl.util.xxhash

public Class XXH3State

extends Struct<XXH3State>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Annotations
@NativeType:struct XXH3_state_t
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

The state struct for the XXH3 streaming API.

This structure has a strict alignment requirement of 64 bytes! Do not allocate this with malloc(), it will not be sufficiently aligned. Use XXHash#XXH3_createState and XXHash#XXH3_freeState, or stack allocation.

Layout


struct XXH3_state_t {
    XXH64_hash_t acc[8];
    unsigned char customSecret[XXH3_SECRET_DEFAULT_SIZE];
    char[64 - (XXH3_SECRET_DEFAULT_SIZE & 63)];
    unsigned char buffer[256];
    XXH32_hash_t bufferedSize;
    XXH32_hash_t useSeed;
    size_t nbStripesSoFar;
    XXH64_hash_t totalLen;
    size_t nbStripesPerBlock;
    size_t secretLimit;
    XXH64_hash_t seed;
    XXH64_hash_t reserved64;
    unsigned char const * extSecret;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
XXH3State.Buffer

An array of XXH3State structs.

Field Summary

Modifier and TypeField and Description
public static final int
ACC

The struct member offsets.

public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
BUFFER

The struct member offsets.

public static final int
BUFFEREDSIZE

The struct member offsets.

public static final int
CUSTOMSECRET

The struct member offsets.

public static final int
EXTSECRET

The struct member offsets.

public static final int
NBSTRIPESPERBLOCK

The struct member offsets.

public static final int
NBSTRIPESSOFAR

The struct member offsets.

public static final int
RESERVED64

The struct member offsets.

public static final int
SECRETLIMIT

The struct member offsets.

public static final int
SEED

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
TOTALLEN

The struct member offsets.

public static final int
USESEED

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
XXH3State(long address, ByteBuffer container)

public
XXH3State(ByteBuffer container)

Creates a XXH3State instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public LongBuffer
acc()

the 8 accumulators.

public long
acc(int index)

the 8 accumulators.

public ByteBuffer
buffer()

the internal buffer.

public byte
buffer(int index)

the internal buffer.

public int
bufferedSize()

the amount of memory in buffer, See XXH32_state_s::memsize.

public static XXH3State
calloc()

Returns a new XXH3State instance allocated with memCalloc.

public static XXH3State.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new XXH3State.Buffer instance allocated with memCalloc.

public static XXH3State
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new XXH3State instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static XXH3State.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new XXH3State.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static XXH3State
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static XXH3State
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static XXH3State.Buffer
callocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static XXH3State.Buffer
callocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
protected XXH3State
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static XXH3State
create()

Returns a new XXH3State instance allocated with BufferUtils.

public static XXH3State
create(long address)

Returns a new XXH3State instance for the specified memory address.

public static XXH3State.Buffer
create(int
the buffer capacity
capacity
)

Returns a new XXH3State.Buffer instance allocated with BufferUtils.

public static XXH3State.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a XXH3State.Buffer instance at the specified memory.

public static XXH3State
createSafe(long address)

Like create, but returns null if address is NULL.

public static XXH3State.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public ByteBuffer
customSecret()

used to store a custom secret generated from a seed

public byte
customSecret(int index)

used to store a custom secret generated from a seed

public ByteBuffer

Returns:

reference to an external secret for the _withSecret variants, NULL for other variants
extSecret
(int
the number of elements in the returned buffer
capacity
)

public static XXH3State
malloc()

Returns a new XXH3State instance allocated with memAlloc.

public static XXH3State.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new XXH3State.Buffer instance allocated with memAlloc.

public static XXH3State
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new XXH3State instance allocated on the specified MemoryStack.

public static XXH3State.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new XXH3State.Buffer instance allocated on the specified MemoryStack.

public static XXH3State
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static XXH3State
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static XXH3State.Buffer
mallocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static XXH3State.Buffer
mallocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static LongBuffer
nacc(long struct)

Unsafe version of acc.

public static long
nacc(long struct, int index)

Unsafe version of acc.

public long
nbStripesPerBlock()

number of stripes per block

public long
nbStripesSoFar()

number or stripes processed

public static ByteBuffer
nbuffer(long struct)

Unsafe version of buffer.

public static byte
nbuffer(long struct, int index)

Unsafe version of buffer.

public static int
nbufferedSize(long struct)

Unsafe version of bufferedSize.

public static ByteBuffer
ncustomSecret(long struct)

Unsafe version of customSecret.

public static byte
ncustomSecret(long struct, int index)

Unsafe version of customSecret.

public static ByteBuffer
nextSecret(long struct, int capacity)

Unsafe version of extSecret.

public static long
nnbStripesPerBlock(long struct)

Unsafe version of nbStripesPerBlock.

public static long
nnbStripesSoFar(long struct)

Unsafe version of nbStripesSoFar.

public static long
nreserved64(long struct)

Unsafe version of reserved64.

public static long
nsecretLimit(long struct)

Unsafe version of secretLimit.

public static long
nseed(long struct)

Unsafe version of seed.

public static long
ntotalLen(long struct)

Unsafe version of totalLen.

public static int
nuseSeed(long struct)

Unsafe version of useSeed.

public long
reserved64()

reserved field

public long
secretLimit()

size of customSecret or extSecret

public long
seed()

seed for _withSeed variants.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public long
totalLen()

total length hashed.

public int
useSeed()

reserved field.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ACCback to summary
public static final int ACC

The struct member offsets.

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

BUFFERback to summary
public static final int BUFFER

The struct member offsets.

BUFFEREDSIZEback to summary
public static final int BUFFEREDSIZE

The struct member offsets.

CUSTOMSECRETback to summary
public static final int CUSTOMSECRET

The struct member offsets.

EXTSECRETback to summary
public static final int EXTSECRET

The struct member offsets.

NBSTRIPESPERBLOCKback to summary
public static final int NBSTRIPESPERBLOCK

The struct member offsets.

NBSTRIPESSOFARback to summary
public static final int NBSTRIPESSOFAR

The struct member offsets.

RESERVED64back to summary
public static final int RESERVED64

The struct member offsets.

SECRETLIMITback to summary
public static final int SECRETLIMIT

The struct member offsets.

SEEDback to summary
public static final int SEED

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

TOTALLENback to summary
public static final int TOTALLEN

The struct member offsets.

USESEEDback to summary
public static final int USESEED

The struct member offsets.

Constructor Detail

XXH3Stateback to summary
protected XXH3State(long address, ByteBuffer container)
XXH3Stateback to summary
public XXH3State(ByteBuffer container)

Creates a XXH3State instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

The created instance holds a strong reference to the container object.

Method Detail

accback to summary
public LongBuffer acc()

the 8 accumulators. Similar to v in XXH32_state_s and XXH64_state_s.

Annotations
@NativeType:XXH64_hash_t[8]
accback to summary
public long acc(int index)

the 8 accumulators. Similar to v in XXH32_state_s and XXH64_state_s.

Annotations
@NativeType:XXH64_hash_t
bufferback to summary
public ByteBuffer buffer()

the internal buffer. See XXH32_state_s::mem32.

Annotations
@NativeType:unsigned char[256]
bufferback to summary
public byte buffer(int index)

the internal buffer. See XXH32_state_s::mem32.

Annotations
@NativeType:unsigned char
bufferedSizeback to summary
public int bufferedSize()

the amount of memory in buffer, See XXH32_state_s::memsize.

Annotations
@NativeType:XXH32_hash_t
callocback to summary
public static XXH3State calloc()

Returns a new XXH3State instance allocated with memCalloc. The instance must be explicitly freed.

callocback to summary
public static XXH3State.Buffer calloc(int capacity)

Returns a new XXH3State.Buffer instance allocated with memCalloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

callocback to summary
public static XXH3State calloc(MemoryStack stack)

Returns a new XXH3State instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
stack:MemoryStack

the stack from which to allocate

callocback to summary
public static XXH3State.Buffer calloc(int capacity, MemoryStack stack)

Returns a new XXH3State.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

callocStackback to summary
public static XXH3State callocStack()

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static XXH3State callocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static XXH3State.Buffer callocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static XXH3State.Buffer callocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
createback to summary
protected XXH3State create(long address, ByteBuffer container)

Implements abstract org.lwjgl.system.Struct.create.

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static XXH3State create()

Returns a new XXH3State instance allocated with BufferUtils.

createback to summary
public static XXH3State create(long address)

Returns a new XXH3State instance for the specified memory address.

createback to summary
public static XXH3State.Buffer create(int capacity)

Returns a new XXH3State.Buffer instance allocated with BufferUtils.

Parameters
capacity:int

the buffer capacity

createback to summary
public static XXH3State.Buffer create(long address, int capacity)

Create a XXH3State.Buffer instance at the specified memory.

Parameters
address:long

the memory address

capacity:int

the buffer capacity

createSafeback to summary
public static XXH3State createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
createSafeback to summary
public static XXH3State.Buffer createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

Annotations
@Nullable
customSecretback to summary
public ByteBuffer customSecret()

used to store a custom secret generated from a seed

Annotations
@NativeType:unsigned char[XXH3_SECRET_DEFAULT_SIZE]
customSecretback to summary
public byte customSecret(int index)

used to store a custom secret generated from a seed

Annotations
@NativeType:unsigned char
extSecretback to summary
public ByteBuffer extSecret(int capacity)
Parameters
capacity:int

the number of elements in the returned buffer

Returns:ByteBuffer

reference to an external secret for the _withSecret variants, NULL for other variants

Annotations
@NativeType:unsigned char const *
mallocback to summary
public static XXH3State malloc()

Returns a new XXH3State instance allocated with memAlloc. The instance must be explicitly freed.

mallocback to summary
public static XXH3State.Buffer malloc(int capacity)

Returns a new XXH3State.Buffer instance allocated with memAlloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

mallocback to summary
public static XXH3State malloc(MemoryStack stack)

Returns a new XXH3State instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

mallocback to summary
public static XXH3State.Buffer malloc(int capacity, MemoryStack stack)

Returns a new XXH3State.Buffer instance allocated on the specified MemoryStack.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

mallocStackback to summary
public static XXH3State mallocStack()

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static XXH3State mallocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static XXH3State.Buffer mallocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static XXH3State.Buffer mallocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
naccback to summary
public static LongBuffer nacc(long struct)

Unsafe version of acc.

naccback to summary
public static long nacc(long struct, int index)

Unsafe version of acc.

nbStripesPerBlockback to summary
public long nbStripesPerBlock()

number of stripes per block

Annotations
@NativeType:size_t
nbStripesSoFarback to summary
public long nbStripesSoFar()

number or stripes processed

Annotations
@NativeType:size_t
nbufferback to summary
public static ByteBuffer nbuffer(long struct)

Unsafe version of buffer.

nbufferback to summary
public static byte nbuffer(long struct, int index)

Unsafe version of buffer.

nbufferedSizeback to summary
public static int nbufferedSize(long struct)

Unsafe version of bufferedSize.

ncustomSecretback to summary
public static ByteBuffer ncustomSecret(long struct)

Unsafe version of customSecret.

ncustomSecretback to summary
public static byte ncustomSecret(long struct, int index)

Unsafe version of customSecret.

nextSecretback to summary
public static ByteBuffer nextSecret(long struct, int capacity)

Unsafe version of extSecret.

nnbStripesPerBlockback to summary
public static long nnbStripesPerBlock(long struct)

Unsafe version of nbStripesPerBlock.

nnbStripesSoFarback to summary
public static long nnbStripesSoFar(long struct)

Unsafe version of nbStripesSoFar.

nreserved64back to summary
public static long nreserved64(long struct)

Unsafe version of reserved64.

nsecretLimitback to summary
public static long nsecretLimit(long struct)

Unsafe version of secretLimit.

nseedback to summary
public static long nseed(long struct)

Unsafe version of seed.

ntotalLenback to summary
public static long ntotalLen(long struct)

Unsafe version of totalLen.

nuseSeedback to summary
public static int nuseSeed(long struct)

Unsafe version of useSeed.

reserved64back to summary
public long reserved64()

reserved field

Annotations
@NativeType:XXH64_hash_t
secretLimitback to summary
public long secretLimit()

size of customSecret or extSecret

Annotations
@NativeType:size_t
seedback to summary
public long seed()

seed for _withSeed variants. Must be zero otherwise, see XXH3_INITSTATE().

Annotations
@NativeType:XXH64_hash_t
sizeofback to summary
public int sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
totalLenback to summary
public long totalLen()

total length hashed. 64-bit even on 32-bit targets.

Annotations
@NativeType:XXH64_hash_t
useSeedback to summary
public int useSeed()

reserved field. Needed for padding on 64-bit.

Annotations
@NativeType:XXH32_hash_t
org.lwjgl.util.xxhash back to summary

public Class XXH3State.Buffer

extends StructBuffer<XXH3State, XXH3State.Buffer>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable

An array of XXH3State structs.

Field Summary

Modifier and TypeField and Description
private static final XXH3State

Constructor Summary

AccessConstructor and Description
public
Buffer(ByteBuffer container)

Creates a new XXH3State.Buffer instance backed by the specified container.

public
Buffer(long address, int cap)

pack-priv
Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Summary

Modifier and TypeMethod and Description
public LongBuffer

Returns:

a LongBuffer view of the XXH3State#acc field.
acc
()

public long

Returns:

the value at the specified index of the XXH3State#acc field.
acc
(int index)

public ByteBuffer

Returns:

a ByteBuffer view of the XXH3State#buffer field.
buffer
()

public byte

Returns:

the value at the specified index of the XXH3State#buffer field.
buffer
(int index)

public int

Returns:

the value of the XXH3State#bufferedSize field.
bufferedSize
()

public ByteBuffer

Returns:

a ByteBuffer view of the XXH3State#customSecret field.
customSecret
()

public byte

Returns:

the value at the specified index of the XXH3State#customSecret field.
customSecret
(int index)

public ByteBuffer

Returns:

a ByteBuffer view of the data pointed to by the XXH3State#extSecret field.
extSecret
(int
the number of elements in the returned buffer
capacity
)

protected XXH3State
public long

Returns:

the value of the XXH3State#nbStripesPerBlock field.
nbStripesPerBlock
()

public long

Returns:

the value of the XXH3State#nbStripesSoFar field.
nbStripesSoFar
()

public long

Returns:

the value of the XXH3State#reserved64 field.
reserved64
()

public long

Returns:

the value of the XXH3State#secretLimit field.
secretLimit
()

public long

Returns:

the value of the XXH3State#seed field.
seed
()

protected XXH3State.Buffer
public long

Returns:

the value of the XXH3State#totalLen field.
totalLen
()

public int

Returns:

the value of the XXH3State#useSeed field.
useSeed
()

Inherited from org.lwjgl.system.StructBuffer:
applyapplyforEachgetgetgetgetiteratorparallelStreamputputsizeofspliteratorstream

Field Detail

ELEMENT_FACTORYback to summary
private static final XXH3State ELEMENT_FACTORY

Constructor Detail

Bufferback to summary
public Buffer(ByteBuffer container)

Creates a new XXH3State.Buffer instance backed by the specified container.

Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by XXH3State#SIZEOF, and its mark will be undefined.

The created buffer instance holds a strong reference to the container object.

Bufferback to summary
public Buffer(long address, int cap)
Bufferback to summary
pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Detail

accback to summary
public LongBuffer acc()
Returns:LongBuffer

a LongBuffer view of the XXH3State#acc field.

Annotations
@NativeType:XXH64_hash_t[8]
accback to summary
public long acc(int index)
Returns:long

the value at the specified index of the XXH3State#acc field.

Annotations
@NativeType:XXH64_hash_t
bufferback to summary
public ByteBuffer buffer()
Returns:ByteBuffer

a ByteBuffer view of the XXH3State#buffer field.

Annotations
@NativeType:unsigned char[256]
bufferback to summary
public byte buffer(int index)
Returns:byte

the value at the specified index of the XXH3State#buffer field.

Annotations
@NativeType:unsigned char
bufferedSizeback to summary
public int bufferedSize()
Returns:int

the value of the XXH3State#bufferedSize field.

Annotations
@NativeType:XXH32_hash_t
customSecretback to summary
public ByteBuffer customSecret()
Returns:ByteBuffer

a ByteBuffer view of the XXH3State#customSecret field.

Annotations
@NativeType:unsigned char[XXH3_SECRET_DEFAULT_SIZE]
customSecretback to summary
public byte customSecret(int index)
Returns:byte

the value at the specified index of the XXH3State#customSecret field.

Annotations
@NativeType:unsigned char
extSecretback to summary
public ByteBuffer extSecret(int capacity)
Parameters
capacity:int

the number of elements in the returned buffer

Returns:ByteBuffer

a ByteBuffer view of the data pointed to by the XXH3State#extSecret field.

Annotations
@NativeType:unsigned char const *
getElementFactoryback to summary
protected XXH3State getElementFactory()

Implements abstract org.lwjgl.system.StructBuffer.getElementFactory.

Annotations
@Override
nbStripesPerBlockback to summary
public long nbStripesPerBlock()
Returns:long

the value of the XXH3State#nbStripesPerBlock field.

Annotations
@NativeType:size_t
nbStripesSoFarback to summary
public long nbStripesSoFar()
Returns:long

the value of the XXH3State#nbStripesSoFar field.

Annotations
@NativeType:size_t
reserved64back to summary
public long reserved64()
Returns:long

the value of the XXH3State#reserved64 field.

Annotations
@NativeType:XXH64_hash_t
secretLimitback to summary
public long secretLimit()
Returns:long

the value of the XXH3State#secretLimit field.

Annotations
@NativeType:size_t
seedback to summary
public long seed()
Returns:long

the value of the XXH3State#seed field.

Annotations
@NativeType:XXH64_hash_t
selfback to summary
protected XXH3State.Buffer self()

Implements abstract org.lwjgl.system.CustomBuffer.self.

Annotations
@Override
totalLenback to summary
public long totalLen()
Returns:long

the value of the XXH3State#totalLen field.

Annotations
@NativeType:XXH64_hash_t
useSeedback to summary
public int useSeed()
Returns:int

the value of the XXH3State#useSeed field.

Annotations
@NativeType:XXH32_hash_t