Class spng_unknown_chunk

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class spng_unknown_chunk extends Struct<spng_unknown_chunk> implements NativeResource

 struct spng_unknown_chunk {
     uint8_t type[4];
     size_t length;
     void * data;
     spng_location location;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int TYPE
      The struct member offsets.
    • LENGTH

      public static final int LENGTH
      The struct member offsets.
    • DATA

      public static final int DATA
      The struct member offsets.
    • LOCATION

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

    • spng_unknown_chunk

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

      public ByteBuffer type()
      Returns:
      a ByteBuffer view of the type field.
    • type

      public byte type(int index)
      Returns:
      the value at the specified index of the type field.
    • length

      public long length()
      Returns:
      the value of the length field.
    • data

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

      public int location()
      Returns:
      the value of the location field.
    • type

      public spng_unknown_chunk type(ByteBuffer value)
      Copies the specified ByteBuffer to the type field.
    • type

      public spng_unknown_chunk type(int index, byte value)
      Sets the specified value at the specified index of the type field.
    • data

      public spng_unknown_chunk data(ByteBuffer value)
      Sets the address of the specified ByteBuffer to the data field.
    • location

      public spng_unknown_chunk location(int value)
      Sets the specified value to the location field.
    • set

      public spng_unknown_chunk set(ByteBuffer type, ByteBuffer data, int location)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static ByteBuffer ntype(long struct)
      Unsafe version of type().
    • ntype

      public static byte ntype(long struct, int index)
      Unsafe version of type.
    • nlength

      public static long nlength(long struct)
      Unsafe version of length().
    • ndata

      public static ByteBuffer ndata(long struct)
      Unsafe version of data.
    • nlocation

      public static int nlocation(long struct)
      Unsafe version of location().
    • ntype

      public static void ntype(long struct, ByteBuffer value)
      Unsafe version of type.
    • ntype

      public static void ntype(long struct, int index, byte value)
      Unsafe version of type.
    • nlength

      public static void nlength(long struct, long value)
      Sets the specified value to the length field of the specified struct.
    • ndata

      public static void ndata(long struct, ByteBuffer value)
      Unsafe version of data.
    • nlocation

      public static void nlocation(long struct, int value)
      Unsafe version of location.
    • validate

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