Package org.lwjgl.util.zstd
Class ZSTDOutBuffer
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.zstd.ZSTDOutBuffer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class ZSTDOutBuffer extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Member documentation
dst
– start of output buffersize
– size of output bufferpos
– position where writing stopped. Will be updated. Necessarily 0 ≤pos
≤size
Layout
struct ZSTD_outBuffer { void * dst; size_t size; size_t pos; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ZSTDOutBuffer.Buffer
An array ofZSTDOutBuffer
structs.
-
Constructor Summary
Constructors Constructor Description ZSTDOutBuffer(java.nio.ByteBuffer container)
Creates aZSTDOutBuffer
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ZSTDOutBuffer
calloc()
Returns a newZSTDOutBuffer
instance allocated withmemCalloc
.static ZSTDOutBuffer.Buffer
calloc(int capacity)
Returns a newZSTDOutBuffer.Buffer
instance allocated withmemCalloc
.static ZSTDOutBuffer
callocStack()
Returns a newZSTDOutBuffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ZSTDOutBuffer.Buffer
callocStack(int capacity)
Returns a newZSTDOutBuffer.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ZSTDOutBuffer.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDOutBuffer.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ZSTDOutBuffer
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDOutBuffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ZSTDOutBuffer
create()
Returns a newZSTDOutBuffer
instance allocated withBufferUtils
.static ZSTDOutBuffer.Buffer
create(int capacity)
Returns a newZSTDOutBuffer.Buffer
instance allocated withBufferUtils
.static ZSTDOutBuffer
create(long address)
Returns a newZSTDOutBuffer
instance for the specified memory address.static ZSTDOutBuffer.Buffer
create(long address, int capacity)
Create aZSTDOutBuffer.Buffer
instance at the specified memory.static ZSTDOutBuffer
createSafe(long address)
static ZSTDOutBuffer.Buffer
createSafe(long address, int capacity)
java.nio.ByteBuffer
dst()
Returns aByteBuffer
view of the data pointed to by thedst
field.ZSTDOutBuffer
dst(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to thedst
field.static ZSTDOutBuffer
malloc()
Returns a newZSTDOutBuffer
instance allocated withmemAlloc
.static ZSTDOutBuffer.Buffer
malloc(int capacity)
Returns a newZSTDOutBuffer.Buffer
instance allocated withmemAlloc
.static ZSTDOutBuffer
mallocStack()
Returns a newZSTDOutBuffer
instance allocated on the thread-localMemoryStack
.static ZSTDOutBuffer.Buffer
mallocStack(int capacity)
Returns a newZSTDOutBuffer.Buffer
instance allocated on the thread-localMemoryStack
.static ZSTDOutBuffer.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDOutBuffer.Buffer
instance allocated on the specifiedMemoryStack
.static ZSTDOutBuffer
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDOutBuffer
instance allocated on the specifiedMemoryStack
.static java.nio.ByteBuffer
ndst(long struct)
Unsafe version ofdst
.static void
ndst(long struct, java.nio.ByteBuffer value)
Unsafe version ofdst
.static long
npos(long struct)
Unsafe version ofpos()
.static void
npos(long struct, long value)
Unsafe version ofpos
.static long
nsize(long struct)
Unsafe version ofsize()
.static void
nsize(long struct, long value)
Sets the specified value to thesize
field of the specifiedstruct
.long
pos()
Returns the value of thepos
field.ZSTDOutBuffer
pos(long value)
Sets the specified value to thepos
field.ZSTDOutBuffer
set(java.nio.ByteBuffer dst, long pos)
Initializes this struct with the specified values.ZSTDOutBuffer
set(ZSTDOutBuffer src)
Copies the specified struct data to this struct.long
size()
Returns the value of thesize
field.int
sizeof()
static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
ZSTDOutBuffer
public ZSTDOutBuffer(java.nio.ByteBuffer container)
Creates aZSTDOutBuffer
instance at the current position of the specifiedByteBuffer
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
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
dst
public java.nio.ByteBuffer dst()
Returns aByteBuffer
view of the data pointed to by thedst
field.
-
size
public long size()
Returns the value of thesize
field.
-
pos
public long pos()
Returns the value of thepos
field.
-
dst
public ZSTDOutBuffer dst(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to thedst
field.
-
pos
public ZSTDOutBuffer pos(long value)
Sets the specified value to thepos
field.
-
set
public ZSTDOutBuffer set(java.nio.ByteBuffer dst, long pos)
Initializes this struct with the specified values.
-
set
public ZSTDOutBuffer set(ZSTDOutBuffer src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static ZSTDOutBuffer malloc()
Returns a newZSTDOutBuffer
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static ZSTDOutBuffer calloc()
Returns a newZSTDOutBuffer
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static ZSTDOutBuffer create()
Returns a newZSTDOutBuffer
instance allocated withBufferUtils
.
-
create
public static ZSTDOutBuffer create(long address)
Returns a newZSTDOutBuffer
instance for the specified memory address.
-
createSafe
@Nullable public static ZSTDOutBuffer createSafe(long address)
-
malloc
public static ZSTDOutBuffer.Buffer malloc(int capacity)
Returns a newZSTDOutBuffer.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static ZSTDOutBuffer.Buffer calloc(int capacity)
Returns a newZSTDOutBuffer.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static ZSTDOutBuffer.Buffer create(int capacity)
Returns a newZSTDOutBuffer.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static ZSTDOutBuffer.Buffer create(long address, int capacity)
Create aZSTDOutBuffer.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static ZSTDOutBuffer.Buffer createSafe(long address, int capacity)
-
mallocStack
public static ZSTDOutBuffer mallocStack()
Returns a newZSTDOutBuffer
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static ZSTDOutBuffer callocStack()
Returns a newZSTDOutBuffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static ZSTDOutBuffer mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDOutBuffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static ZSTDOutBuffer callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDOutBuffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static ZSTDOutBuffer.Buffer mallocStack(int capacity)
Returns a newZSTDOutBuffer.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static ZSTDOutBuffer.Buffer callocStack(int capacity)
Returns a newZSTDOutBuffer.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static ZSTDOutBuffer.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDOutBuffer.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static ZSTDOutBuffer.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDOutBuffer.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
ndst
public static java.nio.ByteBuffer ndst(long struct)
Unsafe version ofdst
.
-
nsize
public static long nsize(long struct)
Unsafe version ofsize()
.
-
npos
public static long npos(long struct)
Unsafe version ofpos()
.
-
ndst
public static void ndst(long struct, java.nio.ByteBuffer value)
Unsafe version ofdst
.
-
nsize
public static void nsize(long struct, long value)
Sets the specified value to thesize
field of the specifiedstruct
.
-
npos
public static void npos(long struct, long value)
Unsafe version ofpos
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-