Class StructBuffer<T extends Struct,SELF extends StructBuffer<T,SELF>>

    • Method Detail

      • get

        public T get()
        Relative get method. Reads the struct at this buffer's current position, and then increments the position.

        The struct instance returned is a view of the buffer at the current position. Changes to this buffer's content will be visible in the struct instance and vice versa.

        Returns:
        the struct at the buffer's current position
        Throws:
        java.nio.BufferUnderflowException - If the buffer's current position is not smaller than its limit
      • get

        public SELF get(T value)
        Relative get method. Reads the struct data at this buffer's current position into the specified struct, and then increments the position.
        Returns:
        the struct at the buffer's current position
        Throws:
        java.nio.BufferUnderflowException - If the buffer's current position is not smaller than its limit
      • put

        public SELF put(T value)
        Relative put method  (optional operation).

        Writes the specified struct into this buffer at the current position, and then increments the position.

        Parameters:
        value - the struct to be written
        Returns:
        This buffer
        Throws:
        java.nio.BufferOverflowException - If this buffer's current position is not smaller than its limit
        java.nio.ReadOnlyBufferException - If this buffer is read-only
      • get

        public T get(int index)
        Absolute get method. Reads the struct at the specified index.

        The struct instance returned is a view of the buffer at the specified position. Changes to this buffer's content will be visible in the struct instance and vice versa.

        Parameters:
        index - the index from which the struct will be read
        Returns:
        the struct at the specified index
        Throws:
        java.lang.IndexOutOfBoundsException - If index is negative or not smaller than the buffer's limit
      • get

        public SELF get(int index,
                        T value)
        Absolute get method. Reads the struct data at the specified index into the specified struct.
        Parameters:
        index - the index from which the struct will be read
        Returns:
        the struct at the specified index
        Throws:
        java.lang.IndexOutOfBoundsException - If index is negative or not smaller than the buffer's limit
      • put

        public SELF put(int index,
                        T value)
        Absolute put method  (optional operation).

        Writes the specified struct into this buffer at the specified index.

        Parameters:
        index - the index at which the struct will be written
        value - the struct value to be written
        Returns:
        This buffer
        Throws:
        java.lang.IndexOutOfBoundsException - If index is negative or not smaller than the buffer's limit
        java.nio.ReadOnlyBufferException - If this buffer is read-only
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T extends Struct>
      • forEach

        public void forEach(java.util.function.Consumer<? super T> action)
        Specified by:
        forEach in interface java.lang.Iterable<T extends Struct>
      • spliterator

        public java.util.Spliterator<T> spliterator()
        Specified by:
        spliterator in interface java.lang.Iterable<T extends Struct>
      • stream

        public java.util.stream.Stream<T> stream()
        Returns a sequential Stream with this struct buffer as its source.
      • parallelStream

        public java.util.stream.Stream<T> parallelStream()
        Returns a parallel Stream with this struct buffer as its source.