Here you can find the source of getFloatBuffer(float[] list)
Parameter | Description |
---|---|
lista | de floats |
public static FloatBuffer getFloatBuffer(float[] list)
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; public class Main { /**// w w w.ja v a 2s .c om * Genera un FloatBuffer a partir de un array de floats * @param lista de floats * @return FloatBuffer resultante */ public static FloatBuffer getFloatBuffer(float[] list) { ByteBuffer bb = ByteBuffer.allocateDirect(list.length * Float.SIZE / 8); bb.order(ByteOrder.nativeOrder()); FloatBuffer fb = bb.asFloatBuffer(); fb.put(list); fb.position(0); return fb; } }