Here you can find the source of createFloatBuffer(int size)
public static FloatBuffer createFloatBuffer(int size)
//package com.java2s; 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(); }// w w w . j av a 2s . c o m public static ByteBuffer createByteBuffer(int size) { return ByteBuffer.allocateDirect(size).order( ByteOrder.nativeOrder()); } }