Package org.lwjgl.util.zstd
Class ZSTDInBuffer
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.zstd.ZSTDInBuffer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class ZSTDInBuffer extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Member documentation
src
– start of input buffersize
– size of input bufferpos
– position where reading stopped. Will be updated. Necessarily 0 ≤pos
≤size
Layout
struct ZSTD_inBuffer { void const * src; size_t size; size_t pos; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ZSTDInBuffer.Buffer
An array ofZSTDInBuffer
structs.
-
Constructor Summary
Constructors Constructor Description ZSTDInBuffer(java.nio.ByteBuffer container)
Creates aZSTDInBuffer
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 ZSTDInBuffer
calloc()
Returns a newZSTDInBuffer
instance allocated withmemCalloc
.static ZSTDInBuffer.Buffer
calloc(int capacity)
Returns a newZSTDInBuffer.Buffer
instance allocated withmemCalloc
.static ZSTDInBuffer
callocStack()
Returns a newZSTDInBuffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ZSTDInBuffer.Buffer
callocStack(int capacity)
Returns a newZSTDInBuffer.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ZSTDInBuffer.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDInBuffer.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ZSTDInBuffer
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDInBuffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ZSTDInBuffer
create()
Returns a newZSTDInBuffer
instance allocated withBufferUtils
.static ZSTDInBuffer.Buffer
create(int capacity)
Returns a newZSTDInBuffer.Buffer
instance allocated withBufferUtils
.static ZSTDInBuffer
create(long address)
Returns a newZSTDInBuffer
instance for the specified memory address.static ZSTDInBuffer.Buffer
create(long address, int capacity)
Create aZSTDInBuffer.Buffer
instance at the specified memory.static ZSTDInBuffer
createSafe(long address)
static ZSTDInBuffer.Buffer
createSafe(long address, int capacity)
static ZSTDInBuffer
malloc()
Returns a newZSTDInBuffer
instance allocated withmemAlloc
.static ZSTDInBuffer.Buffer
malloc(int capacity)
Returns a newZSTDInBuffer.Buffer
instance allocated withmemAlloc
.static ZSTDInBuffer
mallocStack()
Returns a newZSTDInBuffer
instance allocated on the thread-localMemoryStack
.static ZSTDInBuffer.Buffer
mallocStack(int capacity)
Returns a newZSTDInBuffer.Buffer
instance allocated on the thread-localMemoryStack
.static ZSTDInBuffer.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDInBuffer.Buffer
instance allocated on the specifiedMemoryStack
.static ZSTDInBuffer
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDInBuffer
instance allocated on the specifiedMemoryStack
.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
.static java.nio.ByteBuffer
nsrc(long struct)
Unsafe version ofsrc
.static void
nsrc(long struct, java.nio.ByteBuffer value)
Unsafe version ofsrc
.long
pos()
Returns the value of thepos
field.ZSTDInBuffer
pos(long value)
Sets the specified value to thepos
field.ZSTDInBuffer
set(java.nio.ByteBuffer src, long pos)
Initializes this struct with the specified values.ZSTDInBuffer
set(ZSTDInBuffer src)
Copies the specified struct data to this struct.long
size()
Returns the value of thesize
field.int
sizeof()
java.nio.ByteBuffer
src()
Returns aByteBuffer
view of the data pointed to by thesrc
field.ZSTDInBuffer
src(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to thesrc
field.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
-
ZSTDInBuffer
public ZSTDInBuffer(java.nio.ByteBuffer container)
Creates aZSTDInBuffer
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
-
src
public java.nio.ByteBuffer src()
Returns aByteBuffer
view of the data pointed to by thesrc
field.
-
size
public long size()
Returns the value of thesize
field.
-
pos
public long pos()
Returns the value of thepos
field.
-
src
public ZSTDInBuffer src(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to thesrc
field.
-
pos
public ZSTDInBuffer pos(long value)
Sets the specified value to thepos
field.
-
set
public ZSTDInBuffer set(java.nio.ByteBuffer src, long pos)
Initializes this struct with the specified values.
-
set
public ZSTDInBuffer set(ZSTDInBuffer src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static ZSTDInBuffer malloc()
Returns a newZSTDInBuffer
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static ZSTDInBuffer calloc()
Returns a newZSTDInBuffer
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static ZSTDInBuffer create()
Returns a newZSTDInBuffer
instance allocated withBufferUtils
.
-
create
public static ZSTDInBuffer create(long address)
Returns a newZSTDInBuffer
instance for the specified memory address.
-
createSafe
@Nullable public static ZSTDInBuffer createSafe(long address)
-
malloc
public static ZSTDInBuffer.Buffer malloc(int capacity)
Returns a newZSTDInBuffer.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static ZSTDInBuffer.Buffer calloc(int capacity)
Returns a newZSTDInBuffer.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static ZSTDInBuffer.Buffer create(int capacity)
Returns a newZSTDInBuffer.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static ZSTDInBuffer.Buffer create(long address, int capacity)
Create aZSTDInBuffer.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static ZSTDInBuffer.Buffer createSafe(long address, int capacity)
-
mallocStack
public static ZSTDInBuffer mallocStack()
Returns a newZSTDInBuffer
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static ZSTDInBuffer callocStack()
Returns a newZSTDInBuffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static ZSTDInBuffer mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDInBuffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static ZSTDInBuffer callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDInBuffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static ZSTDInBuffer.Buffer mallocStack(int capacity)
Returns a newZSTDInBuffer.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static ZSTDInBuffer.Buffer callocStack(int capacity)
Returns a newZSTDInBuffer.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static ZSTDInBuffer.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDInBuffer.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static ZSTDInBuffer.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDInBuffer.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nsrc
public static java.nio.ByteBuffer nsrc(long struct)
Unsafe version ofsrc
.
-
nsize
public static long nsize(long struct)
Unsafe version ofsize()
.
-
npos
public static long npos(long struct)
Unsafe version ofpos()
.
-
nsrc
public static void nsrc(long struct, java.nio.ByteBuffer value)
Unsafe version ofsrc
.
-
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
-
-