Java tutorial
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; public class Main { public static FloatBuffer createFloatBuffer(int floatCount) { ByteBuffer data = ByteBuffer.allocateDirect(floatCount * 4); data.order(ByteOrder.nativeOrder()); FloatBuffer p1 = data.asFloatBuffer(); return p1; } }