Here you can find the source of makeFloatBuffer(float[] i_arr)
public static FloatBuffer makeFloatBuffer(float[] i_arr)
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; public class Main { public static FloatBuffer makeFloatBuffer(int i_len) { ByteBuffer bb = ByteBuffer.allocateDirect(i_len * 4); bb.order(ByteOrder.nativeOrder()); FloatBuffer fb = bb.asFloatBuffer(); fb.position(0);/*from w w w . j a v a2 s.co m*/ return fb; } public static FloatBuffer makeFloatBuffer(float[] i_arr) { ByteBuffer bb = ByteBuffer.allocateDirect(i_arr.length * 4); bb.order(ByteOrder.nativeOrder()); FloatBuffer fb = bb.asFloatBuffer(); fb.put(i_arr); fb.position(0); return fb; } }