Class IOURingBuf

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class IOURingBuf extends Struct<IOURingBuf> implements NativeResource

 struct io_uring_buf {
     __u64 addr;
     __u32 len;
     __u16 bid;
     __u16 resv;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int ADDR
      The struct member offsets.
    • LEN

      public static final int LEN
      The struct member offsets.
    • BID

      public static final int BID
      The struct member offsets.
    • RESV

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

    • IOURingBuf

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

      public long addr()
      Returns:
      the value of the addr field.
    • len

      public int len()
      Returns:
      the value of the len field.
    • bid

      public short bid()
      Returns:
      the value of the bid field.
    • addr

      public IOURingBuf addr(long value)
      Sets the specified value to the addr field.
    • len

      public IOURingBuf len(int value)
      Sets the specified value to the len field.
    • bid

      public IOURingBuf bid(short value)
      Sets the specified value to the bid field.
    • set

      public IOURingBuf set(long addr, int len, short bid)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static long naddr(long struct)
      Unsafe version of addr().
    • nlen

      public static int nlen(long struct)
      Unsafe version of len().
    • nbid

      public static short nbid(long struct)
      Unsafe version of bid().
    • nresv

      public static short nresv(long struct)
    • naddr

      public static void naddr(long struct, long value)
      Unsafe version of addr.
    • nlen

      public static void nlen(long struct, int value)
      Unsafe version of len.
    • nbid

      public static void nbid(long struct, short value)
      Unsafe version of bid.
    • nresv

      public static void nresv(long struct, short value)