Android FloatBuffer Create list2FloatBuffer(List list)

Here you can find the source of list2FloatBuffer(List list)

Description

list Float Buffer

Declaration

public static FloatBuffer list2FloatBuffer(List<Float> list)

Method Source Code

//package com.java2s;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.util.List;

public class Main {
    public static FloatBuffer list2FloatBuffer(List<Float> list) {
        ByteBuffer ibb = ByteBuffer.allocateDirect(list.size() << 2);
        ibb.order(ByteOrder.nativeOrder());
        FloatBuffer fbb = ibb.asFloatBuffer();
        for (float f : list) {
            fbb.put(f);/*from ww w. j ava  2s  . c  o m*/
        }
        fbb.position(0);
        return fbb;
    }
}

Related

  1. arr2FloatBuffer(float[] coords)
  2. floatToBuffer(float[] a)
  3. floatToBuffer(float[] a)
  4. setupFloatBuffer(FloatBuffer preBuffer, float[] array)
  5. list2FloatBuffer(List arr)
  6. getFloatBuffer(float[] list)
  7. buildFloatBuffer(float[] buffer)
  8. asFloatBuffer(float[] array)
  9. wrap(float[] buffer)