List of utility methods to do FloatBuffer Create
FloatBuffer | createFloatBuffer(int size) create Float Buffer ByteBuffer bf = ByteBuffer.allocateDirect(size * 4);
return bf.order(ByteOrder.nativeOrder()).asFloatBuffer();
|
FloatBuffer | createFloatBuffer(int size) create Float Buffer return createByteBuffer(size << 2).asFloatBuffer();
|
FloatBuffer | createFloatBuffer(int size) create Float Buffer ByteBuffer bb = ByteBuffer.allocateDirect(size * 4);
bb.order(ByteOrder.nativeOrder());
return bb.asFloatBuffer();
|
FloatBuffer | createDirectFloatBuffer( final int capacity) create Direct Float Buffer return createDirectByteBuffer(capacity * BYTES_PER_FLOAT)
.asFloatBuffer();
|
FloatBuffer | createDirectFloatBuffer( final int capacity, final FloatBuffer previous) create Direct Float Buffer final FloatBuffer created = createDirectFloatBuffer(capacity); if (null != previous) { previous.flip(); created.put(previous); return created; |
FloatBuffer | makeFloatBuffer(float[] arr) make Float Buffer ByteBuffer bb = ByteBuffer.allocateDirect(arr.length * 4);
bb.order(ByteOrder.nativeOrder());
FloatBuffer fb = bb.asFloatBuffer();
fb.put(arr);
fb.position(0);
return fb;
|
FloatBuffer | makeFloatBuffer(float[] arr) make Float Buffer ByteBuffer bb = ByteBuffer.allocateDirect(arr.length * 4);
bb.order(ByteOrder.nativeOrder());
FloatBuffer fb = bb.asFloatBuffer();
fb.put(arr);
fb.position(0);
return fb;
|
FloatBuffer | makeFloatBuffer(int size) make Float Buffer ByteBuffer bb = ByteBuffer.allocateDirect(size * 4);
bb.order(ByteOrder.nativeOrder());
FloatBuffer fb = bb.asFloatBuffer();
fb.position(0);
return fb;
|
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();
|