Android examples for java.nio:FloatBuffer
create FloatBuffer by size
import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; public class Main{ public static final FloatBuffer createFloatBuffer(int size) { return ByteBuffer .allocateDirect(size * DatatypeUtils.FLOAT_SIZE_BYTES) .order(ByteOrder.nativeOrder()).asFloatBuffer(); }//from www .ja va 2 s.c o m }