Class ElementBuffer

    • Method Detail

      • allocate

        public static ElementBuffer allocate​(int elementSize,
                                             int elemCount)
        Returns a non direct PointerBuffer in native order, having a backup array
      • allocateDirect

        public static ElementBuffer allocateDirect​(int elementSize,
                                                   int elemCount)
        Returns a direct PointerBuffer in native order, w/o backup array
      • wrap

        public static ElementBuffer wrap​(int elementSize,
                                         ByteBuffer src,
                                         int srcByteOffset,
                                         int elemCount)
      • derefPointer

        public static ElementBuffer derefPointer​(int elementSize,
                                                 long aptr,
                                                 int elemCount)
      • derefPointer

        public static ElementBuffer derefPointer​(int elementSize,
                                                 ByteBuffer ptrSrc,
                                                 int ptrSrcByteOffset,
                                                 int elemCount)
      • put

        public final ElementBuffer put​(ElementBuffer src)
        Description copied from interface: NativeBuffer
        Relative bulk get method. Copy the source values src[position .. capacity] [ to this buffer and increment the position by capacity-position.
      • slice

        public final ByteBuffer slice​(int offset,
                                      int length)
        Returns a slice of this instance's ByteBuffer `[offset..offset+length)`, i.e. referencing the underlying bytes.
        Parameters:
        offset - starting element-index within this buffer
        length - element count
        Returns:
        slice of this instance's ByteBuffer
      • get

        public final ByteBuffer get​(int srcElemPos,
                                    ByteBuffer destElemBytes,
                                    int destElemPos,
                                    int elemCount)
        Absolute get method. Get element-bytes for `elemCount` elements from this buffer at `srcElemPos` into `destElemBytes` at the given element-index `destElemPos`
      • get

        public final ByteBuffer get​(int srcElemPos,
                                    ByteBuffer destElemBytes)
        Absolute get method. Copy the element-bytes from this buffer at the given element-index `srcElemPos`, storing them into `destElemBytes`.
      • get

        public final ByteBuffer get​(ByteBuffer destElemBytes)
        Relative get method. Copy the element-bytes at the current position and increment the position by one, storing the element-bytes into `destElemBytes`.
      • get

        public final ElementBuffer get​(ByteBuffer[] destElements,
                                       int destElemPos,
                                       int elemCount)
        Relative bulk get method. Copy the element-bytes [ position .. position+elemCount [ to the destination array [ destElements[destElemPos] .. destElements[destElemPos+elemCount] [ and increment the position by elemCount.
      • get

        public final ElementBuffer get​(int srcElemPos,
                                       byte[] dest,
                                       int destElemPos,
                                       int elemCount)
        Absolute get method. Get byte-elements for `elemCount` elements from this buffer at `srcElemPos` into `dest` at the given element-index `destElemPos`
      • get

        public final ElementBuffer get​(int srcElemPos,
                                       short[] dest,
                                       int destElemPos,
                                       int elemCount)
        Absolute get method. Get short-elements for `elemCount` elements from this buffer at `srcElemPos` into `dest` at the given element-index `destElemPos`
      • get

        public final ElementBuffer get​(int srcElemPos,
                                       char[] dest,
                                       int destElemPos,
                                       int elemCount)
        Absolute get method. Get char-elements for `elemCount` elements from this buffer at `srcElemPos` into `dest` at the given element-index `destElemPos`
      • get

        public final ElementBuffer get​(int srcElemPos,
                                       int[] dest,
                                       int destElemPos,
                                       int elemCount)
        Absolute get method. Get int-elements for `elemCount` elements from this buffer at `srcElemPos` into `dest` at the given element-index `destElemPos`
      • get

        public final ElementBuffer get​(int srcElemPos,
                                       float[] dest,
                                       int destElemPos,
                                       int elemCount)
        Absolute get method. Get float-elements for `elemCount` elements from this buffer at `srcElemPos` into `dest` at the given element-index `destElemPos`
      • get

        public final ElementBuffer get​(int srcElemPos,
                                       long[] dest,
                                       int destElemPos,
                                       int elemCount)
        Absolute get method. Get long-elements for `elemCount` elements from this buffer at `srcElemPos` into `dest` at the given element-index `destElemPos`
      • get

        public final ElementBuffer get​(int srcElemPos,
                                       double[] dest,
                                       int destElemPos,
                                       int elemCount)
        Absolute get method. Get double-elements for `elemCount` elements from this buffer at `srcElemPos` into `dest` at the given element-index `destElemPos`
      • put

        public final ElementBuffer put​(ByteBuffer srcElemBytes,
                                       int srcElemPos,
                                       int destElemPos,
                                       int elemCount)
        Absolute put method. Put element-bytes for `elemCount` elements from `srcElemBytes` at `srcElemPos` into this buffer at the given element-index `destElemPos`
      • put

        public final ElementBuffer put​(int destElemPos,
                                       ByteBuffer srcElemBytes)
        Absolute put method. Put element-bytes from `srcElemBytes` into the given element-index `destElemPos`
      • put

        public final ElementBuffer put​(ByteBuffer srcElemBytes)
        Relative put method. Put the element-bytes at the current position and increment the position by one.
      • put

        public final ElementBuffer put​(ByteBuffer[] srcElements,
                                       int offset,
                                       int length)
        Relative bulk put method. Put the element-bytes [ srcElements[offset] .. srcElements[offset+length] [ at the current position and increment the position by length.
      • put

        public final ElementBuffer put​(byte[] src,
                                       int srcElemPos,
                                       int destElemPos,
                                       int elemCount)
        Absolute put method. Put byte-elements for `elemCount` elements from `src` at `srcElemPos` into this buffer at the given element-index `destElemPos`
      • put

        public final ElementBuffer put​(short[] src,
                                       int srcElemPos,
                                       int destElemPos,
                                       int elemCount)
        Absolute put method. Put short-elements for `elemCount` elements from `src` at `srcElemPos` into this buffer at the given element-index `destElemPos`
      • put

        public final ElementBuffer put​(char[] src,
                                       int srcElemPos,
                                       int destElemPos,
                                       int elemCount)
        Absolute put method. Put char-elements for `elemCount` elements from `src` at `srcElemPos` into this buffer at the given element-index `destElemPos`
      • put

        public final ElementBuffer put​(int[] src,
                                       int srcElemPos,
                                       int destElemPos,
                                       int elemCount)
        Absolute put method. Put int-elements for `elemCount` elements from `src` at `srcElemPos` into this buffer at the given element-index `destElemPos`
      • put

        public final ElementBuffer put​(float[] src,
                                       int srcElemPos,
                                       int destElemPos,
                                       int elemCount)
        Absolute put method. Put float-elements for `elemCount` elements from `src` at `srcElemPos` into this buffer at the given element-index `destElemPos`
      • put

        public final ElementBuffer put​(long[] src,
                                       int srcElemPos,
                                       int destElemPos,
                                       int elemCount)
        Absolute put method. Put long-elements for `elemCount` elements from `src` at `srcElemPos` into this buffer at the given element-index `destElemPos`
      • put

        public final ElementBuffer put​(double[] src,
                                       int srcElemPos,
                                       int destElemPos,
                                       int elemCount)
        Absolute put method. Put double-elements for `elemCount` elements from `src` at `srcElemPos` into this buffer at the given element-index `destElemPos`