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

public Class ZSTDSequence

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

Layout


struct ZSTD_Sequence {
    unsigned int offset;
    unsigned int litLength;
    unsigned int matchLength;
    unsigned int rep;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ZSTDSequence.Buffer

An array of ZSTDSequence structs.

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
LITLENGTH

The struct member offsets.

public static final int
MATCHLENGTH

The struct member offsets.

public static final int
OFFSET

The struct member offsets.

public static final int
REP

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

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

public
ZSTDSequence(ByteBuffer container)

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

Method Summary

Modifier and TypeMethod and Description
public static ZSTDSequence
calloc()

Returns a new ZSTDSequence instance allocated with memCalloc.

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

Returns a new ZSTDSequence.Buffer instance allocated with memCalloc.

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

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

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

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

protected ZSTDSequence
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 ZSTDSequence
create()

Returns a new ZSTDSequence instance allocated with BufferUtils.

public static ZSTDSequence
create(long address)

Returns a new ZSTDSequence instance for the specified memory address.

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

Returns a new ZSTDSequence.Buffer instance allocated with BufferUtils.

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

Create a ZSTDSequence.Buffer instance at the specified memory.

public static ZSTDSequence
createSafe(long address)

Like create, but returns null if address is NULL.

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

Like create, but returns null if address is NULL.

public int
litLength()

literal length of the sequence

public static ZSTDSequence
malloc()

Returns a new ZSTDSequence instance allocated with memAlloc.

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

Returns a new ZSTDSequence.Buffer instance allocated with memAlloc.

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

Returns a new ZSTDSequence instance allocated on the specified MemoryStack.

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

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

public int
matchLength()

match length of the sequence.

public static int
nlitLength(long struct)

Unsafe version of litLength.

public static int
nmatchLength(long struct)

Unsafe version of matchLength.

public static int
noffset(long struct)

Unsafe version of offset.

public static int
nrep(long struct)

Unsafe version of rep.

public int
offset()

the offset of the match.

public int
rep()

Represents which repeat offset is represented by the field offset.

public int
sizeof()

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

Returns sizeof(struct).
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

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

LITLENGTHback to summary
public static final int LITLENGTH

The struct member offsets.

MATCHLENGTHback to summary
public static final int MATCHLENGTH

The struct member offsets.

OFFSETback to summary
public static final int OFFSET

The struct member offsets.

REPback to summary
public static final int REP

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

Constructor Detail

ZSTDSequenceback to summary
protected ZSTDSequence(long address, ByteBuffer container)
ZSTDSequenceback to summary
public ZSTDSequence(ByteBuffer container)

Creates a ZSTDSequence 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

callocback to summary
public static ZSTDSequence calloc()

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

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

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

Parameters
capacity:int

the buffer capacity

callocback to summary
public static ZSTDSequence calloc(MemoryStack stack)

Returns a new ZSTDSequence 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 ZSTDSequence.Buffer calloc(int capacity, MemoryStack stack)

Returns a new ZSTDSequence.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

createback to summary
protected ZSTDSequence 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 ZSTDSequence create()

Returns a new ZSTDSequence instance allocated with BufferUtils.

createback to summary
public static ZSTDSequence create(long address)

Returns a new ZSTDSequence instance for the specified memory address.

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

Returns a new ZSTDSequence.Buffer instance allocated with BufferUtils.

Parameters
capacity:int

the buffer capacity

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

Create a ZSTDSequence.Buffer instance at the specified memory.

Parameters
address:long

the memory address

capacity:int

the buffer capacity

createSafeback to summary
public static ZSTDSequence createSafe(long address)

Like create, but returns null if address is NULL.

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

Like create, but returns null if address is NULL.

Annotations
@Nullable
litLengthback to summary
public int litLength()

literal length of the sequence

Annotations
@NativeType:unsigned int
mallocback to summary
public static ZSTDSequence malloc()

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

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

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

Parameters
capacity:int

the buffer capacity

mallocback to summary
public static ZSTDSequence malloc(MemoryStack stack)

Returns a new ZSTDSequence instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

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

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

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

matchLengthback to summary
public int matchLength()

match length of the sequence.

Note

Users of this API may provide a sequence with matchLength == litLength == offset == 0. In this case, we will treat the sequence as a marker for a block boundary.

Annotations
@NativeType:unsigned int
nlitLengthback to summary
public static int nlitLength(long struct)

Unsafe version of litLength.

nmatchLengthback to summary
public static int nmatchLength(long struct)

Unsafe version of matchLength.

noffsetback to summary
public static int noffset(long struct)

Unsafe version of offset.

nrepback to summary
public static int nrep(long struct)

Unsafe version of rep.

offsetback to summary
public int offset()

the offset of the match. (NOT the same as the offset code)

If offset == 0 and matchLength == 0, this sequence represents the last literals in the block of litLength size.

Annotations
@NativeType:unsigned int
repback to summary
public int rep()

Represents which repeat offset is represented by the field offset. Ranges from [0, 3].

Repeat offsets are essentially previous offsets from previous sequences sorted in recency order. For more detail, see doc/zstd_compression_format.md.


If rep == 0, then offset does not contain a repeat offset.
If rep > 0:
    If litLength != 0:
        rep == 1 --> offset == repeat_offset_1
        rep == 2 --> offset == repeat_offset_2
        rep == 3 --> offset == repeat_offset_3
    If litLength == 0:
        rep == 1 --> offset == repeat_offset_2
        rep == 2 --> offset == repeat_offset_3
        rep == 3 --> offset == repeat_offset_1 - 1

Note

This field is optional. generateSequences will calculate the value of rep, but repeat offsets do not necessarily need to be calculated from an external sequence provider's perspective. For example, compressSequences does not use this rep field at all (as of now).

Annotations
@NativeType:unsigned int
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
org.lwjgl.util.zstd back to summary

public Class ZSTDSequence.Buffer

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

An array of ZSTDSequence structs.

Field Summary

Modifier and TypeField and Description
private static final ZSTDSequence

Constructor Summary

AccessConstructor and Description
public
Buffer(ByteBuffer container)

Creates a new ZSTDSequence.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
protected ZSTDSequence
public int

Returns:

the value of the ZSTDSequence#litLength field.
litLength
()

public int

Returns:

the value of the ZSTDSequence#matchLength field.
matchLength
()

public int

Returns:

the value of the ZSTDSequence#offset field.
offset
()

public int

Returns:

the value of the ZSTDSequence#rep field.
rep
()

protected ZSTDSequence.Buffer
Inherited from org.lwjgl.system.StructBuffer:
applyapplyforEachgetgetgetgetiteratorparallelStreamputputsizeofspliteratorstream

Field Detail

ELEMENT_FACTORYback to summary
private static final ZSTDSequence ELEMENT_FACTORY

Constructor Detail

Bufferback to summary
public Buffer(ByteBuffer container)

Creates a new ZSTDSequence.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 ZSTDSequence#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

getElementFactoryback to summary
protected ZSTDSequence getElementFactory()

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

Annotations
@Override
litLengthback to summary
public int litLength()
Returns:int

the value of the ZSTDSequence#litLength field.

Annotations
@NativeType:unsigned int
matchLengthback to summary
public int matchLength()
Returns:int

the value of the ZSTDSequence#matchLength field.

Annotations
@NativeType:unsigned int
offsetback to summary
public int offset()
Returns:int

the value of the ZSTDSequence#offset field.

Annotations
@NativeType:unsigned int
repback to summary
public int rep()
Returns:int

the value of the ZSTDSequence#rep field.

Annotations
@NativeType:unsigned int
selfback to summary
protected ZSTDSequence.Buffer self()

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

Annotations
@Override