List of utility methods to do FloatBuffer Create
void | copy(float[] src, FloatBuffer dst, int numFloats, int offset) copy dst.clear(); dst.limit(numFloats); dst.put(src, offset, numFloats); dst.flip(); |
FloatBuffer | newFloatBuffer(int numFloats) new Float Buffer ByteBuffer buffer = ByteBuffer.allocateDirect(numFloats * 4);
buffer.order(ByteOrder.nativeOrder());
return buffer.asFloatBuffer();
|
FloatBuffer | newFloatBuffer(int numFloats) new Float Buffer ByteBuffer buffer = ByteBuffer.allocateDirect(numFloats * 4);
buffer.order(ByteOrder.nativeOrder());
return buffer.asFloatBuffer();
|
FloatBuffer | createFloatBuffer(float[] data) Creates a FloatBuffer from the specified float array. FloatBuffer b = createFloatBuffer(data.length);
b.put(data);
b.rewind();
return b;
|
FloatBuffer | createFloatBuffer(float[] floatData) create Float Buffer FloatBuffer buffer = ByteBuffer
.allocateDirect(floatData.length * FLOAT_SIZE_BYTES)
.order(ByteOrder.nativeOrder()).asFloatBuffer()
.put(floatData);
buffer.position(0);
return buffer;
|
FloatBuffer | createFloatBuffer(float[] floatData) create Float Buffer FloatBuffer buffer = ByteBuffer
.allocateDirect(floatData.length * BYTES_PER_FLOAT)
.order(ByteOrder.nativeOrder()).asFloatBuffer()
.put(floatData);
buffer.position(0);
return buffer;
|
FloatBuffer | createFloatBuffer(int capacity) Creates a FloatBuffer with the specified capacity. return createByteBuffer(capacity * 4).asFloatBuffer();
|
FloatBuffer | createFloatBuffer(int floatCount) create Float Buffer ByteBuffer data = ByteBuffer.allocateDirect(floatCount * 4);
data.order(ByteOrder.nativeOrder());
FloatBuffer p1 = data.asFloatBuffer();
return p1;
|
FloatBuffer | createFloatBuffer(int nElements, int stride) create Float Buffer FloatBuffer buffer = ByteBuffer
.allocateDirect(nElements * stride * FLOAT_SIZE_BYTES)
.order(ByteOrder.nativeOrder()).asFloatBuffer();
buffer.position(0);
return buffer;
|
FloatBuffer | createFloatBuffer(int nElements, int stride) create Float Buffer FloatBuffer buffer = ByteBuffer
.allocateDirect(nElements * stride * BYTES_PER_FLOAT)
.order(ByteOrder.nativeOrder()).asFloatBuffer();
buffer.position(0);
return buffer;
|