Record Class SDL_IOStreamInterface

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_IOStreamInterface
All Implemented Interfaces:
IPointer, ISDL_IOStreamInterface

@ValueBasedCandidate @UnsafeConstructor public record SDL_IOStreamInterface(@NotNull MemorySegment segment) extends Record implements ISDL_IOStreamInterface

The function pointers that drive an SDL_IOStream.

Applications can provide this struct to SDL_OpenIO() to create their own implementation of SDL_IOStream. This is not necessarily required, as SDL already offers several common types of I/O streams, via functions like SDL_IOFromFile() and SDL_IOFromMem().

This structure should be initialized using SDL_INIT_INTERFACE()

Since: This struct is available since SDL 3.2.0.

See also:

  • SDL_INIT_INTERFACE

Structure

typedef struct SDL_IOStreamInterface {
    Uint32 version;
    PFN_SDL_IOStreamInterface_size size; // optional
    PFN_SDL_IOStreamInterface_seek seek; // optional
    PFN_SDL_IOStreamInterface_read read; // optional
    PFN_SDL_IOStreamInterface_write write; // optional
    PFN_SDL_IOStreamInterface_flush flush; // optional
    PFN_SDL_IOStreamInterface_close close; // optional
} SDL_IOStreamInterface;

Contracts

The property segment() should always be not-null (segment != NULL && !segment.equals(MemorySegment.NULL)), and properly aligned to LAYOUT.byteAlignment() bytes. To represent null pointer, you may use a Java null instead. See the documentation of IPointer.segment() for more details.

The constructor of this class is marked as UnsafeConstructor, because it does not perform any runtime check. The constructor can be useful for automatic code generators.

Member documentation

  • size() Return the number of bytes in this SDL_IOStream