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

public Class ktxStream

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

Interface of ktxStream.

Layout


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 and Inner Type Summary

Modifier and TypeClass and Description
public static class
ktxStream.Buffer

An array of ktxStream structs.

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
CLOSEONDESTRUCT

The struct member offsets.

public static final int
DATA

The struct member offsets.

public static final int
DATA_CUSTOM_PTR

The struct member offsets.

public static final int
DATA_CUSTOM_PTR_ADDRESS

The struct member offsets.

public static final int
DATA_CUSTOM_PTR_ALLOCATORADDRESS

The struct member offsets.

public static final int
DATA_CUSTOM_PTR_SIZE

The struct member offsets.

public static final int
DATA_FILE

The struct member offsets.

public static final int
DATA_MEM

The struct member offsets.

public static final int
DESTRUCT

The struct member offsets.

public static final int
GETPOS

The struct member offsets.

public static final int
GETSIZE

The struct member offsets.

public static final int
READ

The struct member offsets.

public static final int
READPOS

The struct member offsets.

public static final int
SETPOS

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
SKIP

The struct member offsets.

public static final int
TYPE

The struct member offsets.

public static final int
WRITE

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

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

public
ktxStream(ByteBuffer container)

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

Method Summary

Modifier and TypeMethod and Description
public static ktxStream
calloc()

Returns a new ktxStream instance allocated with memCalloc.

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

Returns a new ktxStream.Buffer instance allocated with memCalloc.

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

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

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

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

public boolean
closeOnDestruct()

close FILE* or dispose of memory on destruct

public ktxStream
closeOnDestruct(boolean value)

Sets the specified value to the closeOnDestruct field.

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

Returns a new ktxStream instance allocated with BufferUtils.

public static ktxStream
create(long address)

Returns a new ktxStream instance for the specified memory address.

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

Returns a new ktxStream.Buffer instance allocated with BufferUtils.

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

Create a ktxStream.Buffer instance at the specified memory.

public static ktxStream
createSafe(long address)

Like create, but returns null if address is NULL.

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

Like create, but returns null if address is NULL.

public ByteBuffer

Returns:

pointer to the data
data_custom_ptr_address
(int
the number of elements in the returned buffer
capacity
)

public ktxStream
data_custom_ptr_address(ByteBuffer value)

Sets the address of the specified ByteBuffer to the data_custom_ptr_address field.

public long
data_custom_ptr_allocatorAddress()

pointer to a memory allocator

public ktxStream
data_custom_ptr_allocatorAddress(long value)

Sets the specified value to the data_custom_ptr_allocatorAddress field.

public long
data_custom_ptr_size()

size of the data

public ktxStream
data_custom_ptr_size(long value)

Sets the specified value to the data_custom_ptr_size field.

public long
data_file()

a stdio FILE pointer for a ktxFileStream

public ktxStream
data_file(long value)

Sets the specified value to the data_file field.

public long
data_mem()

a pointer to a ktxMem struct for a ktxMemStream

public ktxStream
data_mem(long value)

Sets the specified value to the data_mem field.

public ktxStream_destruct
destruct()

destruct the stream

public ktxStream
destruct(ktxStream_destructI value)

Sets the specified value to the destruct field.

public ktxStream_getpos
getpos()

pointer to function for getting current position in stream

public ktxStream
getpos(ktxStream_getposI value)

Sets the specified value to the getpos field.

public ktxStream_getsize
getsize()

pointer to function for querying size

public ktxStream
getsize(ktxStream_getsizeI value)

Sets the specified value to the getsize field.

public static ktxStream
malloc()

Returns a new ktxStream instance allocated with memAlloc.

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

Returns a new ktxStream.Buffer instance allocated with memAlloc.

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

Returns a new ktxStream instance allocated on the specified MemoryStack.

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

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

public static boolean
ncloseOnDestruct(long struct)

Unsafe version of closeOnDestruct.

public static void
ncloseOnDestruct(long struct, boolean value)

Unsafe version of closeOnDestruct.

public static ByteBuffer
ndata_custom_ptr_address(long struct, int capacity)

Unsafe version of data_custom_ptr_address.

public static void
ndata_custom_ptr_address(long struct, ByteBuffer value)

Unsafe version of data_custom_ptr_address.

public static long
public static void
ndata_custom_ptr_allocatorAddress(long struct, long value)

Unsafe version of data_custom_ptr_allocatorAddress.

public static long
ndata_custom_ptr_size(long struct)

Unsafe version of data_custom_ptr_size.

public static void
ndata_custom_ptr_size(long struct, long value)

Sets the specified value to the size field of the specified struct.

public static long
ndata_file(long struct)

Unsafe version of data_file.

public static void
ndata_file(long struct, long value)

Unsafe version of data_file.

public static long
ndata_mem(long struct)

Unsafe version of data_mem.

public static void
ndata_mem(long struct, long value)

Unsafe version of data_mem.

public static ktxStream_destruct
ndestruct(long struct)

Unsafe version of destruct.

public static void
ndestruct(long struct, ktxStream_destructI value)

Unsafe version of destruct.

public static ktxStream_getpos
ngetpos(long struct)

Unsafe version of getpos.

public static void
ngetpos(long struct, ktxStream_getposI value)

Unsafe version of getpos.

public static ktxStream_getsize
ngetsize(long struct)

Unsafe version of getsize.

public static void
ngetsize(long struct, ktxStream_getsizeI value)

Unsafe version of getsize.

public static ktxStream_read
nread(long struct)

Unsafe version of read.

public static void
nread(long struct, ktxStream_readI value)

Unsafe version of read.

public static long
nreadpos(long struct)

Unsafe version of readpos.

public static void
nreadpos(long struct, long value)

Unsafe version of readpos.

public static ktxStream_setpos
nsetpos(long struct)

Unsafe version of setpos.

public static void
nsetpos(long struct, ktxStream_setposI value)

Unsafe version of setpos.

public static ktxStream_skip
nskip(long struct)

Unsafe version of skip.

public static void
nskip(long struct, ktxStream_skipI value)

Unsafe version of skip.

public static int
ntype(long struct)

Unsafe version of type.

public static void
ntype(long struct, int value)

Unsafe version of type.

public static ktxStream_write
nwrite(long struct)

Unsafe version of write.

public static void
nwrite(long struct, ktxStream_writeI value)

Unsafe version of write.

public ktxStream_read
read()

pointer to function for reading bytes

public ktxStream
read(ktxStream_readI value)

Sets the specified value to the read field.

public long
readpos()

used by FileStream for stdin

public ktxStream
readpos(long value)

Sets the specified value to the readpos field.

public ktxStream

Returns:

this struct
set
(ktxStream
the source struct
src
)

Copies the specified struct data to this struct.

public ktxStream_setpos
setpos()

pointer to function for setting current position in stream

public ktxStream
setpos(ktxStream_setposI value)

Sets the specified value to the setpos field.

public int
sizeof()

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

Returns sizeof(struct).
public ktxStream_skip
skip()

pointer to function for skipping bytes

public ktxStream
skip(ktxStream_skipI value)

Sets the specified value to the skip field.

public int

Returns:

the value of the type field.
type
()

public ktxStream
type(int value)

Sets the specified value to the type field.

public static void
validate(long
the struct to validate
struct
)

Validates pointer members that should not be NULL.

public ktxStream_write
write()

pointer to function for writing bytes

public ktxStream
write(ktxStream_writeI value)

Sets the specified value to the write field.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate