Here you can find the source of createFloatBuffer(int size)
public static FloatBuffer createFloatBuffer(int size)
//package com.java2s; //License from project: LGPL import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; public class Main { public static FloatBuffer createFloatBuffer(int size) { return createByteBuffer(size << 2).asFloatBuffer(); }/*from w w w .j ava 2s .co m*/ public static synchronized ByteBuffer createByteBuffer(int size) { return ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder()); } }