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

voidcopy(float[] src, FloatBuffer dst, int numFloats, int offset)
copy
dst.clear();
dst.limit(numFloats);
dst.put(src, offset, numFloats);
dst.flip();
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();
FloatBuffercreateFloatBuffer(float[] data)
Creates a FloatBuffer from the specified float array.
FloatBuffer b = createFloatBuffer(data.length);
b.put(data);
b.rewind();
return b;
FloatBuffercreateFloatBuffer(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;
FloatBuffercreateFloatBuffer(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;
FloatBuffercreateFloatBuffer(int capacity)
Creates a FloatBuffer with the specified capacity.
return createByteBuffer(capacity * 4).asFloatBuffer();
FloatBuffercreateFloatBuffer(int floatCount)
create Float Buffer
ByteBuffer data = ByteBuffer.allocateDirect(floatCount * 4);
data.order(ByteOrder.nativeOrder());
FloatBuffer p1 = data.asFloatBuffer();
return p1;
FloatBuffercreateFloatBuffer(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;
FloatBuffercreateFloatBuffer(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;