Here you can find the source of allocateFloats(final int howmany, final int SIZE)
public static FloatBuffer allocateFloats(final int howmany, final int SIZE)
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; public class Main { public static FloatBuffer allocateFloats(final float[] floatarray, final int SIZE) { FloatBuffer fb = ByteBuffer.allocateDirect(floatarray.length * SIZE).order(ByteOrder.nativeOrder()) .asFloatBuffer();//from www. j a va 2 s . co m fb.put(floatarray).flip(); return fb; } public static FloatBuffer allocateFloats(final int howmany, final int SIZE) { return ByteBuffer.allocateDirect(howmany * SIZE).order(ByteOrder.nativeOrder()).asFloatBuffer(); } }