Class ZSTDSequence
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.zstd.ZSTDSequence
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class ZSTDSequence extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceLayout
struct ZSTD_Sequence { unsigned intoffset(); unsigned intlitLength(); unsigned intmatchLength(); unsigned intrep(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZSTDSequence.BufferAn array ofZSTDSequencestructs.
-
Constructor Summary
Constructors Constructor Description ZSTDSequence(java.nio.ByteBuffer container)Creates aZSTDSequenceinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ZSTDSequencecalloc()Returns a newZSTDSequenceinstance allocated withmemCalloc.static ZSTDSequence.Buffercalloc(int capacity)Returns a newZSTDSequence.Bufferinstance allocated withmemCalloc.static ZSTDSequence.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newZSTDSequence.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static ZSTDSequencecalloc(org.lwjgl.system.MemoryStack stack)Returns a newZSTDSequenceinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static ZSTDSequencecreate()Returns a newZSTDSequenceinstance allocated withBufferUtils.static ZSTDSequence.Buffercreate(int capacity)Returns a newZSTDSequence.Bufferinstance allocated withBufferUtils.static ZSTDSequencecreate(long address)Returns a newZSTDSequenceinstance for the specified memory address.static ZSTDSequence.Buffercreate(long address, int capacity)Create aZSTDSequence.Bufferinstance at the specified memory.static ZSTDSequencecreateSafe(long address)static ZSTDSequence.BuffercreateSafe(long address, int capacity)intlitLength()literal length of the sequencestatic ZSTDSequencemalloc()Returns a newZSTDSequenceinstance allocated withmemAlloc.static ZSTDSequence.Buffermalloc(int capacity)Returns a newZSTDSequence.Bufferinstance allocated withmemAlloc.static ZSTDSequence.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newZSTDSequence.Bufferinstance allocated on the specifiedMemoryStack.static ZSTDSequencemalloc(org.lwjgl.system.MemoryStack stack)Returns a newZSTDSequenceinstance allocated on the specifiedMemoryStack.intmatchLength()match length of the sequence.static intnlitLength(long struct)Unsafe version oflitLength().static intnmatchLength(long struct)Unsafe version ofmatchLength().static intnoffset(long struct)Unsafe version ofoffset().static intnrep(long struct)Unsafe version ofrep().intoffset()the offset of the match.intrep()Represents which repeat offset is represented by the fieldoffset.intsizeof()
-
-
-
Constructor Detail
-
ZSTDSequence
public ZSTDSequence(java.nio.ByteBuffer container)
Creates aZSTDSequenceinstance at the current position of the specifiedByteBuffercontainer. 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
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
offset
public int offset()
the offset of the match. (NOT the same as the offset code)If
offset == 0andmatchLength == 0, this sequence represents the last literals in the block oflitLengthsize.
-
litLength
public int litLength()
literal length of the sequence
-
matchLength
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.
-
rep
public int rep()
Represents which repeat offset is represented by the fieldoffset. 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 - 1Note: This field is optional.
generateSequenceswill calculate the value ofrep, but repeat offsets do not necessarily need to be calculated from an external sequence provider's perspective. For example,compressSequencesdoes not use thisrepfield at all (as of now).
-
malloc
public static ZSTDSequence malloc()
Returns a newZSTDSequenceinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static ZSTDSequence calloc()
Returns a newZSTDSequenceinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static ZSTDSequence create()
Returns a newZSTDSequenceinstance allocated withBufferUtils.
-
create
public static ZSTDSequence create(long address)
Returns a newZSTDSequenceinstance for the specified memory address.
-
createSafe
@Nullable public static ZSTDSequence createSafe(long address)
-
malloc
public static ZSTDSequence.Buffer malloc(int capacity)
Returns a newZSTDSequence.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static ZSTDSequence.Buffer calloc(int capacity)
Returns a newZSTDSequence.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static ZSTDSequence.Buffer create(int capacity)
Returns a newZSTDSequence.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static ZSTDSequence.Buffer create(long address, int capacity)
Create aZSTDSequence.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static ZSTDSequence.Buffer createSafe(long address, int capacity)
-
malloc
public static ZSTDSequence malloc(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDSequenceinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static ZSTDSequence calloc(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDSequenceinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static ZSTDSequence.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDSequence.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static ZSTDSequence.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDSequence.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
noffset
public static int noffset(long struct)
Unsafe version ofoffset().
-
nlitLength
public static int nlitLength(long struct)
Unsafe version oflitLength().
-
nmatchLength
public static int nmatchLength(long struct)
Unsafe version ofmatchLength().
-
nrep
public static int nrep(long struct)
Unsafe version ofrep().
-
-