public void quantize(java.nio.LongBuffer out, Vector3 point, int isMax) { assert out.isDirect() : "Buffer must be allocated direct."; { CollisionJNI.btAxisSweep3InternalInt_quantize(swigCPtr, this, out, point, isMax); } }
public void quantize(java.nio.LongBuffer out, Vector3 point, int isMax) { assert out.isDirect() : "Buffer must be allocated direct."; { CollisionJNI.btAxisSweep3InternalInt_quantize(swigCPtr, this, out, point, isMax); } }
private static boolean isDirect(Buffer buf) { if (buf instanceof FloatBuffer) { return ((FloatBuffer) buf).isDirect(); } if (buf instanceof IntBuffer) { return ((IntBuffer) buf).isDirect(); } if (buf instanceof ShortBuffer) { return ((ShortBuffer) buf).isDirect(); } if (buf instanceof ByteBuffer) { return ((ByteBuffer) buf).isDirect(); } if (buf instanceof DoubleBuffer) { return ((DoubleBuffer) buf).isDirect(); } if (buf instanceof LongBuffer) { return ((LongBuffer) buf).isDirect(); } throw new UnsupportedOperationException(" BufferUtils.isDirect was called on " + buf.getClass().getName()); }
/** * For direct buffers, calls {@link Pointer#Pointer(Buffer)}, while for buffers * backed with an array, allocates enough memory for the array and copies it. * * @param buffer the Buffer to reference or copy * @see #put(long[]) */ public LongPointer(LongBuffer buffer) { super(buffer); if (buffer != null && !buffer.isDirect() && buffer.hasArray()) { long[] array = buffer.array(); allocateArray(array.length - buffer.arrayOffset()); put(array, buffer.arrayOffset(), array.length - buffer.arrayOffset()); position(buffer.position()); limit(buffer.limit()); } } /**
public void quantize(java.nio.LongBuffer out, Vector3 point, int isMax) { assert out.isDirect() : "Buffer must be allocated direct."; { CollisionJNI.btAxisSweep3InternalInt_quantize(swigCPtr, this, out, point, isMax); } }
public boolean isDirect() { return buf.get().isDirect(); }
/** * Enqueue a command to read the given buffer into the given target Buffer. This command will be blocking if and only if the target Buffer is a <b>not</b> a * <i>direct</i> buffer. The size of the data transfer will be computed from the position and limit of the given Buffer. * * @param commandQueue The command queue * @param buffer The source buffer * @param target The target Buffer */ public static void enqueueReadBuffer( cl_command_queue commandQueue, cl_mem buffer, LongBuffer target) { enqueueReadBuffer(commandQueue, buffer, 0, target, !target.isDirect(), null, null); }
/** * Enqueue a command to write the given buffer from the given source Buffer. This command will be blocking if and only if the source Buffer is a <b>not</b> a * <i>direct</i> buffer. The size of the data transfer will be computed from the position and limit of the given Buffer. * * @param commandQueue The command queue * @param buffer The target buffer * @param source The source Buffer */ public static void enqueueWriteBuffer( cl_command_queue commandQueue, cl_mem buffer, LongBuffer source) { enqueueWriteBuffer(commandQueue, buffer, 0, source, !source.isDirect(), null, null); }
private static boolean isDirect(Buffer buf) { if (buf instanceof FloatBuffer) { return ((FloatBuffer) buf).isDirect(); } if (buf instanceof IntBuffer) { return ((IntBuffer) buf).isDirect(); } if (buf instanceof ShortBuffer) { return ((ShortBuffer) buf).isDirect(); } if (buf instanceof ByteBuffer) { return ((ByteBuffer) buf).isDirect(); } if (buf instanceof DoubleBuffer) { return ((DoubleBuffer) buf).isDirect(); } if (buf instanceof LongBuffer) { return ((LongBuffer) buf).isDirect(); } throw new UnsupportedOperationException(" BufferUtils.isDirect was called on " + buf.getClass().getName()); }
public static boolean isDirect(Buffer b) { if (b instanceof ByteBuffer) { return ((ByteBuffer) b).isDirect(); } if (b instanceof IntBuffer) { return ((IntBuffer) b).isDirect(); } if (b instanceof LongBuffer) { return ((LongBuffer) b).isDirect(); } if (b instanceof DoubleBuffer) { return ((DoubleBuffer) b).isDirect(); } if (b instanceof FloatBuffer) { return ((FloatBuffer) b).isDirect(); } if (b instanceof ShortBuffer) { return ((ShortBuffer) b).isDirect(); } if (b instanceof CharBuffer) { return ((CharBuffer) b).isDirect(); } return false; }
return ((DoubleBuffer) buf).isDirect(); } else if (buf instanceof LongBuffer) { return ((LongBuffer) buf).isDirect(); } else if (buf instanceof CharBuffer) { return ((CharBuffer) buf).isDirect();
return null; if (!buffer.isDirect()) { long[] array = buffer.array(); int offset = buffer.arrayOffset();
if (values == null) throw new IllegalArgumentException("Null values"); if (values.isDirect()) { long len = length * 8, off = valuesOffset * 8; long cap = JNI.getDirectBufferCapacity(values);
/** * For direct buffers, calls {@link Pointer#Pointer(Buffer)}, while for buffers * backed with an array, allocates enough memory for the array and copies it. * * @param buffer the Buffer to reference or copy * @see #put(long[]) */ public LongPointer(LongBuffer buffer) { super(buffer); if (buffer != null && !buffer.isDirect() && buffer.hasArray()) { long[] array = buffer.array(); allocateArray(array.length - buffer.arrayOffset()); put(array, buffer.arrayOffset(), array.length - buffer.arrayOffset()); position(buffer.position()); limit(buffer.limit()); } } /**
if(buffer.isDirect())
if (buffer.isDirect())
/** * Creates a new Pointer to the given buffer, taking into * account the position and array offset of the given buffer. * The buffer is assumed to be non-<code>null</code>, and * be either direct or have a backing array. * * @param buffer The buffer * @return The pointer */ private static Pointer computePointer(LongBuffer buffer) { Pointer result = null; if (buffer.isDirect()) { int oldPosition = buffer.position(); buffer.position(0); result = Pointer.to(buffer.slice()).withByteOffset( oldPosition * Sizeof.LONG); buffer.position(oldPosition); } else if (buffer.hasArray()) { LongBuffer t = LongBuffer.wrap(buffer.array()); int elementOffset = buffer.position() + buffer.arrayOffset(); result = Pointer.to(t).withByteOffset( elementOffset * Sizeof.LONG); } return result; }
/** * Creates a new Pointer to the given buffer, taking into * account the position and array offset of the given buffer. * The buffer is assumed to be non-<code>null</code>, and * be either direct or have a backing array. * * @param buffer The buffer * @return The pointer */ private static Pointer computePointer(LongBuffer buffer) { Pointer result = null; if (buffer.isDirect()) { int oldPosition = buffer.position(); buffer.position(0); result = Pointer.to(buffer.slice()).withByteOffset( oldPosition * Sizeof.LONG); buffer.position(oldPosition); } else if (buffer.hasArray()) { LongBuffer t = LongBuffer.wrap(buffer.array()); int elementOffset = buffer.position() + buffer.arrayOffset(); result = Pointer.to(t).withByteOffset( elementOffset * Sizeof.LONG); } return result; }
/** * Creates a new Pointer to the given buffer, taking into * account the position and array offset of the given buffer. * The buffer is assumed to be non-<code>null</code>, and * be either direct or have a backing array. * * @param buffer The buffer * @return The pointer */ private static Pointer computePointer(LongBuffer buffer) { Pointer result = null; if (buffer.isDirect()) { int oldPosition = buffer.position(); buffer.position(0); result = Pointer.to(buffer.slice()).withByteOffset( oldPosition * Sizeof.LONG); buffer.position(oldPosition); } else if (buffer.hasArray()) { LongBuffer t = LongBuffer.wrap(buffer.array()); int elementOffset = buffer.position() + buffer.arrayOffset(); result = Pointer.to(t).withByteOffset( elementOffset * Sizeof.LONG); } return result; }
/** * Creates a new Pointer to the given buffer, taking into * account the position and array offset of the given buffer. * The buffer is assumed to be non-<code>null</code>, and * be either direct or have a backing array. * * @param buffer The buffer * @return The pointer */ private static Pointer computePointer(LongBuffer buffer) { Pointer result = null; if (buffer.isDirect()) { int oldPosition = buffer.position(); buffer.position(0); result = Pointer.to(buffer.slice()).withByteOffset( oldPosition * Sizeof.LONG); buffer.position(oldPosition); } else if (buffer.hasArray()) { LongBuffer t = LongBuffer.wrap(buffer.array()); int elementOffset = buffer.position() + buffer.arrayOffset(); result = Pointer.to(t).withByteOffset( elementOffset * Sizeof.LONG); } return result; }