Class IovArray

    • Field Detail

      • IOV_SIZE

        public static final int IOV_SIZE
        The size of an iovec struct in bytes. This is calculated as we have 2 entries each of the size of the address.
    • Constructor Detail

      • IovArray

        public IovArray()
      • IovArray

        public IovArray​(ByteBuffer memory)
    • Method Detail

      • clear

        public void clear()
      • count

        public int count()
        Returns the number if iov entries.
      • size

        public long size()
        Returns the size in bytes
      • maxBytes

        public long maxBytes()
        Get the maximum amount of bytes that can be added to this IovArray.
        Returns:
        the maximum amount of bytes that can be added to this IovArray.
      • memoryAddress

        public long memoryAddress​(int index)
        Returns the memoryAddress for the given index.
      • release

        public void release()
        Release the IovArray. Once release further using of it may crash the JVM!
      • process

        public boolean process​(int index,
                               ReadableComponent component)
        Description copied from interface: ReadableComponentProcessor
        Process the given component at the given index in the iteration.

        The component object itself is only valid during this call, but the byte buffers, arrays, and native address pointers obtained from it, will be valid until any operation is performed on the buffer, which changes the internal memory.

        Specified by:
        process in interface ReadableComponentProcessor<RuntimeException>
        Parameters:
        index - The current index of the given buffer component, based on the initial index passed to the Buffer.forEachReadable(int, ReadableComponentProcessor) method.
        component - The current buffer component being processed.
        Returns:
        true if the iteration should continue and more components should be processed, otherwise false to stop the iteration early.