Android Utililty Methods FloatBuffer Create

List of utility methods to do FloatBuffer Create

Description

The list of methods to do FloatBuffer Create are organized into topic(s).

Method

FloatBuffercreateFloatBuffer(int size)
create Float Buffer
ByteBuffer bf = ByteBuffer.allocateDirect(size * 4);
return bf.order(ByteOrder.nativeOrder()).asFloatBuffer();
FloatBuffercreateFloatBuffer(int size)
create Float Buffer
return createByteBuffer(size << 2).asFloatBuffer();
FloatBuffercreateFloatBuffer(int size)
create Float Buffer
ByteBuffer bb = ByteBuffer.allocateDirect(size * 4);
bb.order(ByteOrder.nativeOrder());
return bb.asFloatBuffer();
FloatBuffercreateDirectFloatBuffer( final int capacity)
create Direct Float Buffer
return createDirectByteBuffer(capacity * BYTES_PER_FLOAT)
        .asFloatBuffer();
FloatBuffercreateDirectFloatBuffer( 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;
FloatBuffermakeFloatBuffer(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;
FloatBuffermakeFloatBuffer(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;
FloatBuffermakeFloatBuffer(int size)
make Float Buffer
ByteBuffer bb = ByteBuffer.allocateDirect(size * 4);
bb.order(ByteOrder.nativeOrder());
FloatBuffer fb = bb.asFloatBuffer();
fb.position(0);
return fb;
FloatBuffernewFloatBuffer(int numFloats)
new Float Buffer
ByteBuffer buffer = ByteBuffer.allocateDirect(numFloats * 4);
buffer.order(ByteOrder.nativeOrder());
return buffer.asFloatBuffer();
FloatBuffernewFloatBuffer(int numFloats)
new Float Buffer
ByteBuffer buffer = ByteBuffer.allocateDirect(numFloats * 4);
buffer.order(ByteOrder.nativeOrder());
return buffer.asFloatBuffer();