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()
      • writtenMessages

        public int writtenMessages​(int index,
                                   long totalBytes)
        Return the number of messages that have been completely written for the given total number of bytes.
        Parameters:
        index - the start index.
        totalBytes - the total number of bytes
        Returns:
        the number of messages that are totally written for the given number of total bytes.
      • count

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

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

        public void maxBytes​(long maxBytes)
        Set the maximum amount of bytes that can be added to this IovArray via add(long, long, int) or test(Object).

        This will not impact the existing state of the IovArray, and only applies to subsequent calls to add(long, long, int) or test(Object).

        In order to ensure some progress is made at least one Buffer will be accepted even if it's size exceeds this value.

        Parameters:
        maxBytes - the maximum amount of bytes that can be added to this IovArray.
      • 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!
      • addReadable

        public boolean addReadable​(io.netty5.buffer.Buffer buffer)
      • addReadable

        public boolean addReadable​(io.netty5.buffer.BufferComponent component,
                                   int byteCount)
      • addWritable

        public boolean addWritable​(io.netty5.buffer.Buffer buffer)
      • addWritable

        public boolean addWritable​(io.netty5.buffer.BufferComponent component,
                                   int byteCount)