Here you can find the source of toFloatBuffer(float[] array)
public static FloatBuffer toFloatBuffer(float[] array)
//package com.java2s; //License from project: Apache License import java.nio.*; public class Main { public static FloatBuffer toFloatBuffer(float[] array) { ByteBuffer bb = ByteBuffer.allocateDirect(array.length << 2); bb.order(ByteOrder.nativeOrder()); bb.position(0);/* www. j a v a 2 s. co m*/ FloatBuffer fbb = bb.asFloatBuffer(); fbb.put(array); return fbb; } }