List of utility methods to do FloatBuffer Create
FloatBuffer | newFloatBuffer(int paramInt) new Float Buffer ByteBuffer localByteBuffer = newByteBuffer(paramInt * 4);
return localByteBuffer.asFloatBuffer();
|
FloatBuffer | toFloatBuffer(float[] array) to Float Buffer ByteBuffer bb = ByteBuffer.allocateDirect(array.length << 2);
bb.order(ByteOrder.nativeOrder());
bb.position(0);
FloatBuffer fbb = bb.asFloatBuffer();
fbb.put(array);
return fbb;
|
FloatBuffer | arr2FloatBuffer(float[] arr) arr Float Buffer ByteBuffer ibb = ByteBuffer.allocateDirect(arr.length << 2);
ibb.order(ByteOrder.nativeOrder());
FloatBuffer fbb = ibb.asFloatBuffer();
fbb.put(arr);
fbb.position(0);
return fbb;
|
FloatBuffer | arr2FloatBuffer(float[] coords) arr Float Buffer ByteBuffer ibb = ByteBuffer.allocateDirect(coords.length * 4);
ibb.order(ByteOrder.nativeOrder());
FloatBuffer fbb = ibb.asFloatBuffer();
fbb.put(coords);
fbb.position(0);
return fbb;
|
FloatBuffer | floatToBuffer(float[] a) float To Buffer ByteBuffer mbb = ByteBuffer.allocateDirect(a.length * 4);
mbb.order(ByteOrder.nativeOrder());
mBuffer = mbb.asFloatBuffer();
mBuffer.put(a);
mBuffer.position(0);
return mBuffer;
|
FloatBuffer | floatToBuffer(float[] a) float To Buffer ByteBuffer mbb = ByteBuffer.allocateDirect(a.length * 4);
mbb.order(ByteOrder.nativeOrder());
FloatBuffer fBuffer = mbb.asFloatBuffer();
fBuffer.put(a);
fBuffer.position(0);
return fBuffer;
|
FloatBuffer | setupFloatBuffer(FloatBuffer preBuffer, float[] array) setup Float Buffer if (preBuffer == null || preBuffer.capacity() < array.length) { preBuffer = createFloatBuffer(array.length * 2); } else { preBuffer.clear(); preBuffer.put(array); preBuffer.position(0); return preBuffer; ... |
FloatBuffer | list2FloatBuffer(List list Float Buffer ByteBuffer ibb = ByteBuffer.allocateDirect(arr.size() * 4); ibb.order(ByteOrder.nativeOrder()); FloatBuffer fbb = ibb.asFloatBuffer(); for (float f : arr) { fbb.put(f); fbb.position(0); return fbb; ... |
FloatBuffer | list2FloatBuffer(List list Float Buffer ByteBuffer ibb = ByteBuffer.allocateDirect(list.size() << 2); ibb.order(ByteOrder.nativeOrder()); FloatBuffer fbb = ibb.asFloatBuffer(); for (float f : list) { fbb.put(f); fbb.position(0); return fbb; ... |
FloatBuffer | getFloatBuffer(float[] list) Genera un FloatBuffer a partir de un array de floats ByteBuffer bb = ByteBuffer.allocateDirect(list.length * Float.SIZE
/ 8);
bb.order(ByteOrder.nativeOrder());
FloatBuffer fb = bb.asFloatBuffer();
fb.put(list);
fb.position(0);
return fb;
|