Class PointerBuffer

    • Method Detail

      • allocate

        public static PointerBuffer allocate​(int size)
        Returns a non direct PointerBuffer, having a backup array
      • allocateDirect

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

        public static PointerBuffer wrap​(ByteBuffer src,
                                         int srcByteOffset,
                                         int elemCount)
        Wraps given ByteBuffer src @ srcByteOffset to contain elemCount pointers.
        Parameters:
        src -
        srcByteOffset -
        elemCount -
        Returns:
      • derefPointer

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

        public static PointerBuffer derefPointer​(ByteBuffer ptrSrc,
                                                 int ptrSrcByteOffset,
                                                 int elemCount)
      • duplicate

        public final PointerBuffer duplicate()
        Returns:
        new PointerBuffer sharing the same buffer data of this instance (identity), but having an independent position.
      • put

        public final PointerBuffer put​(PointerBuffer 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.
      • get

        public final long get​(int idx)
        Absolute get method. Get the pointer value at the given index
      • get

        public final long get()
        Relative get method. Get the pointer value at the current position and increment the position by one.
      • get

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

        public final PointerBuffer get​(long[] dest,
                                       int destElemPos,
                                       int elemCount)
        Relative bulk get method. Copy the pointer values [ position .. position+elemCount [ to the destination array [ dest[destElemPos] .. dest[destElemPos+elemCount] [ and increment the position by elemCount.
      • put

        public final PointerBuffer put​(int idx,
                                       long v)
        Absolute put method. Put the pointer value at the given index
      • put

        public final PointerBuffer put​(long value)
        Relative put method. Put the pointer value at the current position and increment the position by one.
      • put

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

        public final PointerBuffer put​(long[] src,
                                       int srcElemPos,
                                       int elemCount)
        Relative bulk put method. Put the pointer values [ src[srcElemPos] .. src[srcElemPos+elemCount] [ at the current position and increment the position by elemCount.
      • referenceBuffer

        public final PointerBuffer referenceBuffer​(int index,
                                                   Buffer bb)
        Put the address of the given direct Buffer at the given position of this pointer array. Adding a reference of the given direct Buffer to this object.
        Throws:
        IllegalArgumentException - if bb is null or not a direct buffer
      • referenceBuffer

        public final PointerBuffer referenceBuffer​(Buffer bb)
        Put the address of the given direct Buffer at the end of this pointer array. Adding a reference of the given direct Buffer to this object.
      • getReferencedBuffer

        public final Buffer getReferencedBuffer​(int index)
      • getReferencedBuffer

        public final Buffer getReferencedBuffer()