Android FloatBuffer Create floatToBuffer(float[] a)

Here you can find the source of floatToBuffer(float[] a)

Description

float To Buffer

Declaration

public static FloatBuffer floatToBuffer(float[] a) 

Method Source Code

//package com.java2s;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;

public class Main {
    public static FloatBuffer mBuffer;

    public static FloatBuffer floatToBuffer(float[] a) {
        ByteBuffer mbb = ByteBuffer.allocateDirect(a.length * 4);
        mbb.order(ByteOrder.nativeOrder());
        mBuffer = mbb.asFloatBuffer();//from  w  w w. jav a  2s.c om
        mBuffer.put(a);
        mBuffer.position(0);
        return mBuffer;
    }
}

Related

  1. newFloatBuffer(int numFloats)
  2. newFloatBuffer(int paramInt)
  3. toFloatBuffer(float[] array)
  4. arr2FloatBuffer(float [] arr)
  5. arr2FloatBuffer(float[] coords)
  6. floatToBuffer(float[] a)
  7. setupFloatBuffer(FloatBuffer preBuffer, float[] array)
  8. list2FloatBuffer(List arr)
  9. list2FloatBuffer(List list)