Package org.lwjgl.stb

Class STBVorbisAlloc

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class STBVorbisAlloc
    extends Struct
    implements NativeResource
    A buffer to use for allocations by STBVorbis


     struct stb_vorbis_alloc {
         char * alloc_buffer;
         int alloc_buffer_length_in_bytes;
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.

        The struct member offsets.
    • Constructor Detail

      • STBVorbisAlloc

        public STBVorbisAlloc​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • alloc_buffer

        public java.nio.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​(java.nio.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.
        src - the source struct
        this struct
      • createSafe

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

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

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

        public static java.nio.ByteBuffer nalloc_buffer​(long struct)
        Unsafe version of alloc_buffer.
      • nalloc_buffer

        public static void nalloc_buffer​(long struct,
                                         java.nio.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.
        struct - the struct to validate
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        array - the struct array to validate
        count - the number of structs in array