Android FloatBuffer Create list2FloatBuffer(List arr)

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

Description

list Float Buffer

Declaration

public static FloatBuffer list2FloatBuffer(List<Float> arr) 

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> arr) {

        ByteBuffer ibb = ByteBuffer.allocateDirect(arr.size() * 4);
        ibb.order(ByteOrder.nativeOrder());
        FloatBuffer fbb = ibb.asFloatBuffer();
        for (float f : arr) {
            fbb.put(f);//  w  w  w.ja v a  2s  .  c o  m
        }
        fbb.position(0);
        return fbb;
    }
}

Related

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