Package org.lwjgl.util.ktx
Class ktxStream
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct ktxStream {
ktxStream_read read;
ktxStream_skip skip;
ktxStream_write write;
ktxStream_getpos getpos;
ktxStream_setpos setpos;
ktxStream_getsize getsize;
ktxStream_destruct destruct;
enum streamType type;
union {
FILE * file;
ktxMem * mem;
struct {
void * address;
void * allocatorAddress;
ktx_size_t size;
} custom_ptr;
} data;
ktx_off_t readpos;
ktx_bool_t closeOnDestruct;
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionktxStream(ByteBuffer container) Creates aktxStreaminstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic ktxStreamcalloc()Returns a newktxStreaminstance allocated withmemCalloc.static ktxStream.Buffercalloc(int capacity) Returns a newktxStream.Bufferinstance allocated withmemCalloc.static ktxStream.Buffercalloc(int capacity, MemoryStack stack) Returns a newktxStream.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static ktxStreamcalloc(MemoryStack stack) Returns a newktxStreaminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.booleancloseOnDestruct(boolean value) Sets the specified value to thecloseOnDestructfield.static ktxStreamcreate()Returns a newktxStreaminstance allocated withBufferUtils.static ktxStream.Buffercreate(int capacity) Returns a newktxStream.Bufferinstance allocated withBufferUtils.static ktxStreamcreate(long address) Returns a newktxStreaminstance for the specified memory address.static ktxStream.Buffercreate(long address, int capacity) Create aktxStream.Bufferinstance at the specified memory.static @Nullable ktxStreamcreateSafe(long address) static @Nullable ktxStream.BuffercreateSafe(long address, int capacity) data_custom_ptr_address(int capacity) Sets the address of the specifiedByteBufferto theaddressfield.longdata_custom_ptr_allocatorAddress(long value) Sets the specified value to theallocatorAddressfield.longdata_custom_ptr_size(long value) Sets the specified value to thesizefield.longdata_file(long value) Sets the specified value to thefilefield.longdata_mem()data_mem(long value) Sets the specified value to thememfield.destruct()destruct(ktxStream_destructI value) Sets the specified value to thedestructfield.getpos()getpos(ktxStream_getposI value) Sets the specified value to thegetposfield.getsize()getsize(ktxStream_getsizeI value) Sets the specified value to thegetsizefield.static ktxStreammalloc()Returns a newktxStreaminstance allocated withmemAlloc.static ktxStream.Buffermalloc(int capacity) Returns a newktxStream.Bufferinstance allocated withmemAlloc.static ktxStream.Buffermalloc(int capacity, MemoryStack stack) Returns a newktxStream.Bufferinstance allocated on the specifiedMemoryStack.static ktxStreammalloc(MemoryStack stack) Returns a newktxStreaminstance allocated on the specifiedMemoryStack.static booleanncloseOnDestruct(long struct) Unsafe version ofcloseOnDestruct().static voidncloseOnDestruct(long struct, boolean value) Unsafe version ofcloseOnDestruct.static ByteBufferndata_custom_ptr_address(long struct, int capacity) Unsafe version ofdata_custom_ptr_address.static voidndata_custom_ptr_address(long struct, ByteBuffer value) Unsafe version ofdata_custom_ptr_address.static longndata_custom_ptr_allocatorAddress(long struct) Unsafe version ofdata_custom_ptr_allocatorAddress().static voidndata_custom_ptr_allocatorAddress(long struct, long value) Unsafe version ofdata_custom_ptr_allocatorAddress.static longndata_custom_ptr_size(long struct) Unsafe version ofdata_custom_ptr_size().static voidndata_custom_ptr_size(long struct, long value) Sets the specified value to thesizefield of the specifiedstruct.static longndata_file(long struct) Unsafe version ofdata_file().static voidndata_file(long struct, long value) Unsafe version ofdata_file.static longndata_mem(long struct) Unsafe version ofdata_mem().static voidndata_mem(long struct, long value) Unsafe version ofdata_mem.static ktxStream_destructndestruct(long struct) Unsafe version ofdestruct().static voidndestruct(long struct, ktxStream_destructI value) Unsafe version ofdestruct.static ktxStream_getposngetpos(long struct) Unsafe version ofgetpos().static voidngetpos(long struct, ktxStream_getposI value) Unsafe version ofgetpos.static ktxStream_getsizengetsize(long struct) Unsafe version ofgetsize().static voidngetsize(long struct, ktxStream_getsizeI value) Unsafe version ofgetsize.static ktxStream_readnread(long struct) Unsafe version ofread().static voidnread(long struct, ktxStream_readI value) Unsafe version ofread.static longnreadpos(long struct) Unsafe version ofreadpos().static voidnreadpos(long struct, long value) Unsafe version ofreadpos.static ktxStream_setposnsetpos(long struct) Unsafe version ofsetpos().static voidnsetpos(long struct, ktxStream_setposI value) Unsafe version ofsetpos.static ktxStream_skipnskip(long struct) Unsafe version ofskip().static voidnskip(long struct, ktxStream_skipI value) Unsafe version ofskip.static intntype(long struct) Unsafe version oftype().static voidntype(long struct, int value) Unsafe version oftype.static ktxStream_writenwrite(long struct) Unsafe version ofwrite().static voidnwrite(long struct, ktxStream_writeI value) Unsafe version ofwrite.read()read(ktxStream_readI value) Sets the specified value to thereadfield.longreadpos()readpos(long value) Sets the specified value to thereadposfield.Copies the specified struct data to this struct.setpos()setpos(ktxStream_setposI value) Sets the specified value to thesetposfield.intsizeof()Returnssizeof(struct).skip()skip(ktxStream_skipI value) Sets the specified value to theskipfield.inttype()type(int value) Sets the specified value to thetypefield.static voidvalidate(long struct) Validates pointer members that should not beNULL.write()write(ktxStream_writeI value) Sets the specified value to thewritefield.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
READ
public static final int READThe struct member offsets. -
SKIP
public static final int SKIPThe struct member offsets. -
WRITE
public static final int WRITEThe struct member offsets. -
GETPOS
public static final int GETPOSThe struct member offsets. -
SETPOS
public static final int SETPOSThe struct member offsets. -
GETSIZE
public static final int GETSIZEThe struct member offsets. -
DESTRUCT
public static final int DESTRUCTThe struct member offsets. -
TYPE
public static final int TYPEThe struct member offsets. -
DATA
public static final int DATAThe struct member offsets. -
DATA_FILE
public static final int DATA_FILEThe struct member offsets. -
DATA_MEM
public static final int DATA_MEMThe struct member offsets. -
DATA_CUSTOM_PTR
public static final int DATA_CUSTOM_PTRThe struct member offsets. -
DATA_CUSTOM_PTR_ADDRESS
public static final int DATA_CUSTOM_PTR_ADDRESSThe struct member offsets. -
DATA_CUSTOM_PTR_ALLOCATORADDRESS
public static final int DATA_CUSTOM_PTR_ALLOCATORADDRESSThe struct member offsets. -
DATA_CUSTOM_PTR_SIZE
public static final int DATA_CUSTOM_PTR_SIZEThe struct member offsets. -
READPOS
public static final int READPOSThe struct member offsets. -
CLOSEONDESTRUCT
public static final int CLOSEONDESTRUCTThe struct member offsets.
-
-
Constructor Details
-
ktxStream
Creates aktxStreaminstance 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 Details
-
sizeof
public int sizeof()Description copied from class:StructReturnssizeof(struct). -
read
- Returns:
- the value of the
readfield.
-
skip
- Returns:
- the value of the
skipfield.
-
write
- Returns:
- the value of the
writefield.
-
getpos
- Returns:
- the value of the
getposfield.
-
setpos
- Returns:
- the value of the
setposfield.
-
getsize
- Returns:
- the value of the
getsizefield.
-
destruct
- Returns:
- the value of the
destructfield.
-
type
public int type()- Returns:
- the value of the
typefield.
-
data_file
public long data_file()- Returns:
- the value of the
data.filefield.
-
data_mem
public long data_mem()- Returns:
- the value of the
data.memfield.
-
data_custom_ptr_address
- Returns:
- a
ByteBufferview of the data pointed to by thedata.custom_ptr.addressfield.
-
data_custom_ptr_allocatorAddress
public long data_custom_ptr_allocatorAddress()- Returns:
- the value of the
data.custom_ptr.allocatorAddressfield.
-
data_custom_ptr_size
public long data_custom_ptr_size()- Returns:
- the value of the
data.custom_ptr.sizefield.
-
readpos
public long readpos()- Returns:
- the value of the
readposfield.
-
closeOnDestruct
public boolean closeOnDestruct()- Returns:
- the value of the
closeOnDestructfield.
-
read
Sets the specified value to thereadfield. -
skip
Sets the specified value to theskipfield. -
write
Sets the specified value to thewritefield. -
getpos
Sets the specified value to thegetposfield. -
setpos
Sets the specified value to thesetposfield. -
getsize
Sets the specified value to thegetsizefield. -
destruct
Sets the specified value to thedestructfield. -
type
Sets the specified value to thetypefield. -
data_file
Sets the specified value to thefilefield. -
data_mem
Sets the specified value to thememfield. -
data_custom_ptr_address
Sets the address of the specifiedByteBufferto theaddressfield. -
data_custom_ptr_allocatorAddress
Sets the specified value to theallocatorAddressfield. -
data_custom_ptr_size
Sets the specified value to thesizefield. -
readpos
Sets the specified value to thereadposfield. -
closeOnDestruct
Sets the specified value to thecloseOnDestructfield. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newktxStreaminstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newktxStreaminstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newktxStreaminstance allocated withBufferUtils. -
create
Returns a newktxStreaminstance for the specified memory address. -
createSafe
-
malloc
Returns a newktxStream.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newktxStream.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newktxStream.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aktxStream.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newktxStreaminstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newktxStreaminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newktxStream.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newktxStream.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nread
Unsafe version ofread(). -
nskip
Unsafe version ofskip(). -
nwrite
Unsafe version ofwrite(). -
ngetpos
Unsafe version ofgetpos(). -
nsetpos
Unsafe version ofsetpos(). -
ngetsize
Unsafe version ofgetsize(). -
ndestruct
Unsafe version ofdestruct(). -
ntype
public static int ntype(long struct) Unsafe version oftype(). -
ndata_file
public static long ndata_file(long struct) Unsafe version ofdata_file(). -
ndata_mem
public static long ndata_mem(long struct) Unsafe version ofdata_mem(). -
ndata_custom_ptr_address
Unsafe version ofdata_custom_ptr_address. -
ndata_custom_ptr_allocatorAddress
public static long ndata_custom_ptr_allocatorAddress(long struct) Unsafe version ofdata_custom_ptr_allocatorAddress(). -
ndata_custom_ptr_size
public static long ndata_custom_ptr_size(long struct) Unsafe version ofdata_custom_ptr_size(). -
nreadpos
public static long nreadpos(long struct) Unsafe version ofreadpos(). -
ncloseOnDestruct
public static boolean ncloseOnDestruct(long struct) Unsafe version ofcloseOnDestruct(). -
nread
Unsafe version ofread. -
nskip
Unsafe version ofskip. -
nwrite
Unsafe version ofwrite. -
ngetpos
Unsafe version ofgetpos. -
nsetpos
Unsafe version ofsetpos. -
ngetsize
Unsafe version ofgetsize. -
ndestruct
Unsafe version ofdestruct. -
ntype
public static void ntype(long struct, int value) Unsafe version oftype. -
ndata_file
public static void ndata_file(long struct, long value) Unsafe version ofdata_file. -
ndata_mem
public static void ndata_mem(long struct, long value) Unsafe version ofdata_mem. -
ndata_custom_ptr_address
Unsafe version ofdata_custom_ptr_address. -
ndata_custom_ptr_allocatorAddress
public static void ndata_custom_ptr_allocatorAddress(long struct, long value) Unsafe version ofdata_custom_ptr_allocatorAddress. -
ndata_custom_ptr_size
public static void ndata_custom_ptr_size(long struct, long value) Sets the specified value to thesizefield of the specifiedstruct. -
nreadpos
public static void nreadpos(long struct, long value) Unsafe version ofreadpos. -
ncloseOnDestruct
public static void ncloseOnDestruct(long struct, boolean value) Unsafe version ofcloseOnDestruct. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-