/** * Copies {@code count} floats from {@code src} starting at offset {@code offset} * to the memory pointed to by this {@link FloatPtr}. * * @param src the source. * @param offset the offset within the source array to start copying from. * @param count the number of elements to copy. */ public void set(float[] src, int offset, int count) { asFloatBuffer(count).put(src, offset, count); } }
/** * Copies {@code count} floats from the memory pointed to by this * {@link FloatPtr} to {@code dst} starting at offset {@code offset}. * * @param dst the destination. * @param offset the offset within the destination array to start copying to. * @param count the number of elements to copy. */ public void get(float[] dst, int offset, int count) { asFloatBuffer(count).get(dst, offset, count); }
@SuppressWarnings("unchecked") public <T extends Buffer> T getOutputDataAsBuffer(Class<T> bufferType) { VoidPtr ptr = getOutputDataPointer(); if (bufferType == ByteBuffer.class) { return (T) ptr.as(BytePtr.class).asByteBuffer(getOutputDataSize()); } else if (bufferType == CharBuffer.class) { return (T) ptr.as(CharPtr.class).asCharBuffer(getOutputDataSize()); } else if (bufferType == ShortBuffer.class) { return (T) ptr.as(ShortPtr.class).asShortBuffer(getOutputDataSize()); } else if (bufferType == IntBuffer.class) { return (T) ptr.as(IntPtr.class).asIntBuffer(getOutputDataSize()); } else if (bufferType == LongBuffer.class) { return (T) ptr.as(LongPtr.class).asLongBuffer(getOutputDataSize()); } else if (bufferType == FloatBuffer.class) { return (T) ptr.as(FloatPtr.class).asFloatBuffer(getOutputDataSize()); } else if (bufferType == DoubleBuffer.class) { return (T) ptr.as(DoublePtr.class).asDoubleBuffer(getOutputDataSize()); } else { throw new UnsupportedOperationException("Buffer type not supported: " + bufferType); } }
/** * Copies {@code count} floats from the memory pointed to by this * {@link FloatPtr} to {@code dst} starting at offset {@code offset}. * * @param dst the destination. * @param offset the offset within the destination array to start copying to. * @param count the number of elements to copy. */ public void get(float[] dst, int offset, int count) { asFloatBuffer(count).get(dst, offset, count); }
/** * Copies {@code count} floats from {@code src} starting at offset {@code offset} * to the memory pointed to by this {@link FloatPtr}. * * @param src the source. * @param offset the offset within the source array to start copying from. * @param count the number of elements to copy. */ public void set(float[] src, int offset, int count) { asFloatBuffer(count).put(src, offset, count); } }
/** * Copies {@code count} floats from the memory pointed to by this * {@link FloatPtr} to {@code dst} starting at offset {@code offset}. * * @param dst the destination. * @param offset the offset within the destination array to start copying to. * @param count the number of elements to copy. */ public void get(float[] dst, int offset, int count) { asFloatBuffer(count).get(dst, offset, count); }
/** * Copies {@code count} floats from {@code src} starting at offset {@code offset} * to the memory pointed to by this {@link FloatPtr}. * * @param src the source. * @param offset the offset within the source array to start copying from. * @param count the number of elements to copy. */ public void set(float[] src, int offset, int count) { asFloatBuffer(count).put(src, offset, count); } }
/** * Copies {@code count} floats from {@code src} starting at offset {@code offset} * to the memory pointed to by this {@link FloatPtr}. * * @param src the source. * @param offset the offset within the source array to start copying from. * @param count the number of elements to copy. */ public void set(float[] src, int offset, int count) { asFloatBuffer(count).put(src, offset, count); } }
/** * Copies {@code count} floats from {@code src} starting at offset {@code offset} * to the memory pointed to by this {@link FloatPtr}. * * @param src the source. * @param offset the offset within the source array to start copying from. * @param count the number of elements to copy. */ public void set(float[] src, int offset, int count) { asFloatBuffer(count).put(src, offset, count); } }
/** * Copies {@code count} floats from the memory pointed to by this * {@link FloatPtr} to {@code dst} starting at offset {@code offset}. * * @param dst the destination. * @param offset the offset within the destination array to start copying to. * @param count the number of elements to copy. */ public void get(float[] dst, int offset, int count) { asFloatBuffer(count).get(dst, offset, count); }
/** * Copies {@code count} floats from the memory pointed to by this * {@link FloatPtr} to {@code dst} starting at offset {@code offset}. * * @param dst the destination. * @param offset the offset within the destination array to start copying to. * @param count the number of elements to copy. */ public void get(float[] dst, int offset, int count) { asFloatBuffer(count).get(dst, offset, count); }
/** * Copies {@code count} floats from the memory pointed to by this * {@link FloatPtr} to {@code dst} starting at offset {@code offset}. * * @param dst the destination. * @param offset the offset within the destination array to start copying to. * @param count the number of elements to copy. */ public void get(float[] dst, int offset, int count) { asFloatBuffer(count).get(dst, offset, count); }
/** * Copies {@code count} floats from {@code src} starting at offset {@code offset} * to the memory pointed to by this {@link FloatPtr}. * * @param src the source. * @param offset the offset within the source array to start copying from. * @param count the number of elements to copy. */ public void set(float[] src, int offset, int count) { asFloatBuffer(count).put(src, offset, count); } }
@SuppressWarnings("unchecked") public <T extends Buffer> T getOutputDataAsBuffer(Class<T> bufferType) { VoidPtr ptr = getOutputDataPointer(); if (bufferType == ByteBuffer.class) { return (T) ptr.as(BytePtr.class).asByteBuffer(getOutputDataSize()); } else if (bufferType == CharBuffer.class) { return (T) ptr.as(CharPtr.class).asCharBuffer(getOutputDataSize()); } else if (bufferType == ShortBuffer.class) { return (T) ptr.as(ShortPtr.class).asShortBuffer(getOutputDataSize()); } else if (bufferType == IntBuffer.class) { return (T) ptr.as(IntPtr.class).asIntBuffer(getOutputDataSize()); } else if (bufferType == LongBuffer.class) { return (T) ptr.as(LongPtr.class).asLongBuffer(getOutputDataSize()); } else if (bufferType == FloatBuffer.class) { return (T) ptr.as(FloatPtr.class).asFloatBuffer(getOutputDataSize()); } else if (bufferType == DoubleBuffer.class) { return (T) ptr.as(DoublePtr.class).asDoubleBuffer(getOutputDataSize()); } else { throw new UnsupportedOperationException("Buffer type not supported: " + bufferType); } }
@SuppressWarnings("unchecked") public <T extends Buffer> T getOutputDataAsBuffer(Class<T> bufferType) { VoidPtr ptr = getOutputDataPointer(); if (bufferType == ByteBuffer.class) { return (T) ptr.as(BytePtr.class).asByteBuffer(getOutputDataSize()); } else if (bufferType == CharBuffer.class) { return (T) ptr.as(CharPtr.class).asCharBuffer(getOutputDataSize()); } else if (bufferType == ShortBuffer.class) { return (T) ptr.as(ShortPtr.class).asShortBuffer(getOutputDataSize()); } else if (bufferType == IntBuffer.class) { return (T) ptr.as(IntPtr.class).asIntBuffer(getOutputDataSize()); } else if (bufferType == LongBuffer.class) { return (T) ptr.as(LongPtr.class).asLongBuffer(getOutputDataSize()); } else if (bufferType == FloatBuffer.class) { return (T) ptr.as(FloatPtr.class).asFloatBuffer(getOutputDataSize()); } else if (bufferType == DoubleBuffer.class) { return (T) ptr.as(DoublePtr.class).asDoubleBuffer(getOutputDataSize()); } else { throw new UnsupportedOperationException("Buffer type not supported: " + bufferType); } }