Class AIFile

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class AIFile extends Struct<AIFile> implements NativeResource

 struct aiFile {
     {@link AIFileReadProcI aiFileReadProc} ReadProc;
     {@link AIFileWriteProcI aiFileWriteProc} WriteProc;
     {@link AIFileTellProcI aiFileTellProc} TellProc;
     {@link AIFileTellProcI aiFileTellProc} FileSizeProc;
     {@link AIFileSeekI aiFileSeek} SeekProc;
     {@link AIFileFlushProcI aiFileFlushProc} FlushProc;
     aiUserData UserData;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • READPROC

      public static final int READPROC
      The struct member offsets.
    • WRITEPROC

      public static final int WRITEPROC
      The struct member offsets.
    • TELLPROC

      public static final int TELLPROC
      The struct member offsets.
    • FILESIZEPROC

      public static final int FILESIZEPROC
      The struct member offsets.
    • SEEKPROC

      public static final int SEEKPROC
      The struct member offsets.
    • FLUSHPROC

      public static final int FLUSHPROC
      The struct member offsets.
    • USERDATA

      public static final int USERDATA
      The struct member offsets.
  • Constructor Details

    • AIFile

      public AIFile(ByteBuffer container)
      Creates a AIFile instance at the current position of the specified ByteBuffer 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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<AIFile>
    • ReadProc

      public AIFileReadProc ReadProc()
      Returns:
      the value of the ReadProc field.
    • WriteProc

      public AIFileWriteProc WriteProc()
      Returns:
      the value of the WriteProc field.
    • TellProc

      public AIFileTellProc TellProc()
      Returns:
      the value of the TellProc field.
    • FileSizeProc

      public AIFileTellProc FileSizeProc()
      Returns:
      the value of the FileSizeProc field.
    • SeekProc

      public AIFileSeek SeekProc()
      Returns:
      the value of the SeekProc field.
    • FlushProc

      public AIFileFlushProc FlushProc()
      Returns:
      the value of the FlushProc field.
    • UserData

      public long UserData()
      Returns:
      the value of the UserData field.
    • ReadProc

      public AIFile ReadProc(AIFileReadProcI value)
      Sets the specified value to the ReadProc field.
    • WriteProc

      public AIFile WriteProc(AIFileWriteProcI value)
      Sets the specified value to the WriteProc field.
    • TellProc

      public AIFile TellProc(AIFileTellProcI value)
      Sets the specified value to the TellProc field.
    • FileSizeProc

      public AIFile FileSizeProc(AIFileTellProcI value)
      Sets the specified value to the FileSizeProc field.
    • SeekProc

      public AIFile SeekProc(AIFileSeekI value)
      Sets the specified value to the SeekProc field.
    • FlushProc

      public AIFile FlushProc(AIFileFlushProcI value)
      Sets the specified value to the FlushProc field.
    • UserData

      public AIFile UserData(long value)
      Sets the specified value to the UserData field.
    • set

      public AIFile set(AIFileReadProcI ReadProc, AIFileWriteProcI WriteProc, AIFileTellProcI TellProc, AIFileTellProcI FileSizeProc, AIFileSeekI SeekProc, AIFileFlushProcI FlushProc, long UserData)
      Initializes this struct with the specified values.
    • set

      public AIFile set(AIFile src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static AIFile malloc()
      Returns a new AIFile instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static AIFile calloc()
      Returns a new AIFile instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static AIFile create()
      Returns a new AIFile instance allocated with BufferUtils.
    • create

      public static AIFile create(long address)
      Returns a new AIFile instance for the specified memory address.
    • createSafe

      public static @Nullable AIFile createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static AIFile.Buffer malloc(int capacity)
      Returns a new AIFile.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static AIFile.Buffer calloc(int capacity)
      Returns a new AIFile.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static AIFile.Buffer create(int capacity)
      Returns a new AIFile.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static AIFile.Buffer create(long address, int capacity)
      Create a AIFile.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable AIFile.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • mallocStack

      @Deprecated public static AIFile mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static AIFile callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static AIFile mallocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static AIFile callocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static AIFile.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static AIFile.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static AIFile.Buffer mallocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static AIFile.Buffer callocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static AIFile malloc(MemoryStack stack)
      Returns a new AIFile instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static AIFile calloc(MemoryStack stack)
      Returns a new AIFile instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static AIFile.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new AIFile.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static AIFile.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new AIFile.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nReadProc

      public static AIFileReadProc nReadProc(long struct)
      Unsafe version of ReadProc().
    • nWriteProc

      public static AIFileWriteProc nWriteProc(long struct)
      Unsafe version of WriteProc().
    • nTellProc

      public static AIFileTellProc nTellProc(long struct)
      Unsafe version of TellProc().
    • nFileSizeProc

      public static AIFileTellProc nFileSizeProc(long struct)
      Unsafe version of FileSizeProc().
    • nSeekProc

      public static AIFileSeek nSeekProc(long struct)
      Unsafe version of SeekProc().
    • nFlushProc

      public static AIFileFlushProc nFlushProc(long struct)
      Unsafe version of FlushProc().
    • nUserData

      public static long nUserData(long struct)
      Unsafe version of UserData().
    • nReadProc

      public static void nReadProc(long struct, AIFileReadProcI value)
      Unsafe version of ReadProc.
    • nWriteProc

      public static void nWriteProc(long struct, AIFileWriteProcI value)
      Unsafe version of WriteProc.
    • nTellProc

      public static void nTellProc(long struct, AIFileTellProcI value)
      Unsafe version of TellProc.
    • nFileSizeProc

      public static void nFileSizeProc(long struct, AIFileTellProcI value)
      Unsafe version of FileSizeProc.
    • nSeekProc

      public static void nSeekProc(long struct, AIFileSeekI value)
      Unsafe version of SeekProc.
    • nFlushProc

      public static void nFlushProc(long struct, AIFileFlushProcI value)
      Unsafe version of FlushProc.
    • nUserData

      public static void nUserData(long struct, long value)
      Unsafe version of UserData.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate