Class NkMemory

  • All Implemented Interfaces:

    public class NkMemory
    extends Struct


     struct nk_memory {
         void * ptr;
         nk_size size;
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • PTR, SIZE

        The struct member offsets.
    • Constructor Detail

      • NkMemory

        public NkMemory​(java.nio.ByteBuffer container)
        Creates a NkMemory 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
      • ptr

        public java.nio.ByteBuffer ptr()
        Returns a ByteBuffer view of the data pointed to by the ptr field.
      • size

        public long size()
        Returns the value of the size field.
      • create

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

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

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

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

        public static java.nio.ByteBuffer nptr​(long struct)
        Unsafe version of ptr.
      • nsize

        public static long nsize​(long struct)
        Unsafe version of size().