Package org.lwjgl.util.opus
Class OpusFileCallbacks
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.opus.OpusFileCallbacks
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class OpusFileCallbacks extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceThe callbacks used to access non-FILEstream resources.The function prototypes are basically the same as for the stdio functions
fread(),fseek(),ftell(), andfclose(). The differences are that theFILE *arguments have been replaced with avoid *, which is to be used as a pointer to whatever internal data these functions might need, thatseekandtelltake and return 64-bit offsets, and thatseekmust return-1if the stream is unseekable.Layout
struct OpusFileCallbacks {op_read_funcread();op_seek_funcseek();op_tell_functell();op_close_funcclose; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpusFileCallbacks.BufferAn array ofOpusFileCallbacksstructs.
-
Constructor Summary
Constructors Constructor Description OpusFileCallbacks(java.nio.ByteBuffer container)Creates aOpusFileCallbacksinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OpusFileCallbackscalloc()Returns a newOpusFileCallbacksinstance allocated withmemCalloc.static OpusFileCallbacks.Buffercalloc(int capacity)Returns a newOpusFileCallbacks.Bufferinstance allocated withmemCalloc.static OpusFileCallbacks.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOpusFileCallbacks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OpusFileCallbackscalloc(org.lwjgl.system.MemoryStack stack)Returns a newOpusFileCallbacksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.OPCloseFuncclose$()used to close the stream when the decoder is freed.OpusFileCallbacksclose$(OPCloseFuncI value)Sets the specified value to theclose$()field.static OpusFileCallbackscreate()Returns a newOpusFileCallbacksinstance allocated withBufferUtils.static OpusFileCallbacks.Buffercreate(int capacity)Returns a newOpusFileCallbacks.Bufferinstance allocated withBufferUtils.static OpusFileCallbackscreate(long address)Returns a newOpusFileCallbacksinstance for the specified memory address.static OpusFileCallbacks.Buffercreate(long address, int capacity)Create aOpusFileCallbacks.Bufferinstance at the specified memory.static OpusFileCallbackscreateSafe(long address)static OpusFileCallbacks.BuffercreateSafe(long address, int capacity)static OpusFileCallbacksmalloc()Returns a newOpusFileCallbacksinstance allocated withmemAlloc.static OpusFileCallbacks.Buffermalloc(int capacity)Returns a newOpusFileCallbacks.Bufferinstance allocated withmemAlloc.static OpusFileCallbacks.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOpusFileCallbacks.Bufferinstance allocated on the specifiedMemoryStack.static OpusFileCallbacksmalloc(org.lwjgl.system.MemoryStack stack)Returns a newOpusFileCallbacksinstance allocated on the specifiedMemoryStack.static OPCloseFuncnclose$(long struct)Unsafe version ofclose$().static voidnclose$(long struct, OPCloseFuncI value)Unsafe version ofclose$.static OPReadFuncnread(long struct)Unsafe version ofread().static voidnread(long struct, OPReadFuncI value)Unsafe version ofread.static OPSeekFuncnseek(long struct)Unsafe version ofseek().static voidnseek(long struct, OPSeekFuncI value)Unsafe version ofseek.static OPTellFuncntell(long struct)Unsafe version oftell().static voidntell(long struct, OPTellFuncI value)Unsafe version oftell.OPReadFuncread()used to read data from the stream.OpusFileCallbacksread(OPReadFuncI value)Sets the specified value to theread()field.OPSeekFuncseek()used to seek in the stream.OpusFileCallbacksseek(OPSeekFuncI value)Sets the specified value to theseek()field.OpusFileCallbacksset(OPReadFuncI read, OPSeekFuncI seek, OPTellFuncI tell, OPCloseFuncI close$)Initializes this struct with the specified values.OpusFileCallbacksset(OpusFileCallbacks src)Copies the specified struct data to this struct.intsizeof()OPTellFunctell()used to return the current read position in the stream.OpusFileCallbackstell(OPTellFuncI value)Sets the specified value to thetell()field.static voidvalidate(long struct)Validates pointer members that should not beNULL.
-
-
-
Constructor Detail
-
OpusFileCallbacks
public OpusFileCallbacks(java.nio.ByteBuffer container)
Creates aOpusFileCallbacksinstance 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
-
read
public OPReadFunc read()
used to read data from the stream. This must not beNULL.
-
seek
@Nullable public OPSeekFunc seek()
used to seek in the stream. This may beNULLif seeking is not implemented.
-
tell
@Nullable public OPTellFunc tell()
used to return the current read position in the stream. This may beNULLif seeking is not implemented.
-
close$
@Nullable public OPCloseFunc close$()
used to close the stream when the decoder is freed. This may beNULLto leave the stream open.
-
read
public OpusFileCallbacks read(OPReadFuncI value)
Sets the specified value to theread()field.
-
seek
public OpusFileCallbacks seek(@Nullable OPSeekFuncI value)
Sets the specified value to theseek()field.
-
tell
public OpusFileCallbacks tell(@Nullable OPTellFuncI value)
Sets the specified value to thetell()field.
-
close$
public OpusFileCallbacks close$(@Nullable OPCloseFuncI value)
Sets the specified value to theclose$()field.
-
set
public OpusFileCallbacks set(OPReadFuncI read, OPSeekFuncI seek, OPTellFuncI tell, OPCloseFuncI close$)
Initializes this struct with the specified values.
-
set
public OpusFileCallbacks set(OpusFileCallbacks src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static OpusFileCallbacks malloc()
Returns a newOpusFileCallbacksinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static OpusFileCallbacks calloc()
Returns a newOpusFileCallbacksinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static OpusFileCallbacks create()
Returns a newOpusFileCallbacksinstance allocated withBufferUtils.
-
create
public static OpusFileCallbacks create(long address)
Returns a newOpusFileCallbacksinstance for the specified memory address.
-
createSafe
@Nullable public static OpusFileCallbacks createSafe(long address)
-
malloc
public static OpusFileCallbacks.Buffer malloc(int capacity)
Returns a newOpusFileCallbacks.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static OpusFileCallbacks.Buffer calloc(int capacity)
Returns a newOpusFileCallbacks.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static OpusFileCallbacks.Buffer create(int capacity)
Returns a newOpusFileCallbacks.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static OpusFileCallbacks.Buffer create(long address, int capacity)
Create aOpusFileCallbacks.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static OpusFileCallbacks.Buffer createSafe(long address, int capacity)
-
malloc
public static OpusFileCallbacks malloc(org.lwjgl.system.MemoryStack stack)
Returns a newOpusFileCallbacksinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static OpusFileCallbacks calloc(org.lwjgl.system.MemoryStack stack)
Returns a newOpusFileCallbacksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static OpusFileCallbacks.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOpusFileCallbacks.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static OpusFileCallbacks.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOpusFileCallbacks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nread
public static OPReadFunc nread(long struct)
Unsafe version ofread().
-
nseek
@Nullable public static OPSeekFunc nseek(long struct)
Unsafe version ofseek().
-
ntell
@Nullable public static OPTellFunc ntell(long struct)
Unsafe version oftell().
-
nclose$
@Nullable public static OPCloseFunc nclose$(long struct)
Unsafe version ofclose$().
-
nread
public static void nread(long struct, OPReadFuncI value)Unsafe version ofread.
-
nseek
public static void nseek(long struct, @Nullable OPSeekFuncI value)Unsafe version ofseek.
-
ntell
public static void ntell(long struct, @Nullable OPTellFuncI value)Unsafe version oftell.
-
nclose$
public static void nclose$(long struct, @Nullable OPCloseFuncI value)Unsafe version ofclose$.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-