Android FloatBuffer Create arr2FloatBuffer(float [] arr)

Here you can find the source of arr2FloatBuffer(float [] arr)

Description

arr Float Buffer

Declaration

public static FloatBuffer arr2FloatBuffer(float [] arr)

Method Source Code

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

public class Main {
    public static FloatBuffer arr2FloatBuffer(float[] arr) {
        ByteBuffer ibb = ByteBuffer.allocateDirect(arr.length << 2);
        ibb.order(ByteOrder.nativeOrder());
        FloatBuffer fbb = ibb.asFloatBuffer();
        fbb.put(arr);/*from  ww w .  j a v  a2 s.c o m*/
        fbb.position(0);
        return fbb;
    }
}

Related

  1. makeFloatBuffer(int size)
  2. newFloatBuffer(int numFloats)
  3. newFloatBuffer(int numFloats)
  4. newFloatBuffer(int paramInt)
  5. toFloatBuffer(float[] array)
  6. arr2FloatBuffer(float[] coords)
  7. floatToBuffer(float[] a)
  8. floatToBuffer(float[] a)
  9. setupFloatBuffer(FloatBuffer preBuffer, float[] array)