Class IOVec

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

    public class IOVec
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource

    Layout

    
     struct iovec {
         void * iov_base();
         size_t iov_len();
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  IOVec.Buffer
      An array of IOVec structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
      • Nested classes/interfaces inherited from class org.lwjgl.system.Struct

        org.lwjgl.system.Struct.StructValidation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int IOV_BASE
      IOV_LEN
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      IOVec​(java.nio.ByteBuffer container)
      Creates a IOVec instance at the current position of the specified ByteBuffer container.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static IOVec calloc()
      Returns a new IOVec instance allocated with memCalloc.
      static IOVec.Buffer calloc​(int capacity)
      Returns a new IOVec.Buffer instance allocated with memCalloc.
      static IOVec.Buffer calloc​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new IOVec.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static IOVec calloc​(org.lwjgl.system.MemoryStack stack)
      Returns a new IOVec instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static IOVec create()
      Returns a new IOVec instance allocated with BufferUtils.
      static IOVec.Buffer create​(int capacity)
      Returns a new IOVec.Buffer instance allocated with BufferUtils.
      static IOVec create​(long address)
      Returns a new IOVec instance for the specified memory address.
      static IOVec.Buffer create​(long address, int capacity)
      Create a IOVec.Buffer instance at the specified memory.
      static IOVec createSafe​(long address)
      Like create, but returns null if address is NULL.
      static IOVec.Buffer createSafe​(long address, int capacity)
      Like create, but returns null if address is NULL.
      java.nio.ByteBuffer iov_base()
      starting address
      IOVec iov_base​(java.nio.ByteBuffer value)
      Sets the address of the specified ByteBuffer to the iov_base() field.
      long iov_len()
      number of bytes to transfer
      IOVec iov_len​(long value)
      Sets the specified value to the iov_len() field.
      static IOVec malloc()
      Returns a new IOVec instance allocated with memAlloc.
      static IOVec.Buffer malloc​(int capacity)
      Returns a new IOVec.Buffer instance allocated with memAlloc.
      static IOVec.Buffer malloc​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new IOVec.Buffer instance allocated on the specified MemoryStack.
      static IOVec malloc​(org.lwjgl.system.MemoryStack stack)
      Returns a new IOVec instance allocated on the specified MemoryStack.
      static java.nio.ByteBuffer niov_base​(long struct)
      Unsafe version of iov_base.
      static void niov_base​(long struct, java.nio.ByteBuffer value)
      Unsafe version of iov_base.
      static long niov_len​(long struct)
      Unsafe version of iov_len().
      static void niov_len​(long struct, long value)
      Unsafe version of iov_len.
      IOVec set​(java.nio.ByteBuffer iov_base, long iov_len)
      Initializes this struct with the specified values.
      IOVec set​(IOVec src)
      Copies the specified struct data to this struct.
      int sizeof()  
      • Methods inherited from interface org.lwjgl.system.NativeResource

        close, free
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from class org.lwjgl.system.Pointer.Default

        address, equals, hashCode, toString
      • Methods inherited from class org.lwjgl.system.Struct

        clear, free, isNull, validate
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • IOV_BASE, IOV_LEN

        The struct member offsets.
    • Constructor Detail

      • IOVec

        public IOVec​(java.nio.ByteBuffer container)
        Creates a IOVec 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()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • iov_base

        @Nullable
        public java.nio.ByteBuffer iov_base()
        starting address
      • iov_len

        public long iov_len()
        number of bytes to transfer
      • iov_base

        public IOVec iov_base​(@Nullable
                              java.nio.ByteBuffer value)
        Sets the address of the specified ByteBuffer to the iov_base() field.
      • iov_len

        public IOVec iov_len​(long value)
        Sets the specified value to the iov_len() field.
      • set

        public IOVec set​(@Nullable
                         java.nio.ByteBuffer iov_base,
                         long iov_len)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static IOVec.Buffer calloc​(int capacity,
                                          org.lwjgl.system.MemoryStack stack)
        Returns a new IOVec.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • niov_base

        @Nullable
        public static java.nio.ByteBuffer niov_base​(long struct)
        Unsafe version of iov_base.
      • niov_len

        public static long niov_len​(long struct)
        Unsafe version of iov_len().
      • niov_base

        public static void niov_base​(long struct,
                                     @Nullable
                                     java.nio.ByteBuffer value)
        Unsafe version of iov_base.
      • niov_len

        public static void niov_len​(long struct,
                                    long value)
        Unsafe version of iov_len.