Package org.lwjgl.stb

Class STBVorbisAlloc

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class STBVorbisAlloc extends Struct<STBVorbisAlloc> implements NativeResource

 struct stb_vorbis_alloc {
     char * alloc_buffer;
     int alloc_buffer_length_in_bytes;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int ALLOC_BUFFER
      The struct member offsets.
    • ALLOC_BUFFER_LENGTH_IN_BYTES

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

    • STBVorbisAlloc

      public STBVorbisAlloc(ByteBuffer container)
      Creates a STBVorbisAlloc 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<STBVorbisAlloc>
    • alloc_buffer

      public ByteBuffer alloc_buffer()
      Returns:
      a ByteBuffer view of the data pointed to by the alloc_buffer field.
    • alloc_buffer_length_in_bytes

      public int alloc_buffer_length_in_bytes()
      Returns:
      the value of the alloc_buffer_length_in_bytes field.
    • alloc_buffer

      public STBVorbisAlloc alloc_buffer(ByteBuffer value)
      Sets the address of the specified ByteBuffer to the alloc_buffer field.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static STBVorbisAlloc.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new STBVorbisAlloc.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
    • nalloc_buffer

      public static ByteBuffer nalloc_buffer(long struct)
      Unsafe version of alloc_buffer.
    • nalloc_buffer_length_in_bytes

      public static int nalloc_buffer_length_in_bytes(long struct)
    • nalloc_buffer

      public static void nalloc_buffer(long struct, ByteBuffer value)
      Unsafe version of alloc_buffer.
    • nalloc_buffer_length_in_bytes

      public static void nalloc_buffer_length_in_bytes(long struct, int value)
      Sets the specified value to the alloc_buffer_length_in_bytes field of the specified struct.
    • validate

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