Android FloatBuffer Create arr2FloatBuffer(float[] coords)

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

Description

arr Float Buffer

Declaration

public static FloatBuffer arr2FloatBuffer(float[] coords) 

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[] coords) {
        ByteBuffer ibb = ByteBuffer.allocateDirect(coords.length * 4);
        ibb.order(ByteOrder.nativeOrder());
        FloatBuffer fbb = ibb.asFloatBuffer();
        fbb.put(coords);//from   w w  w  . j av a2s  . c o  m
        fbb.position(0);
        return fbb;
    }
}

Related

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