Android FloatBuffer Create floatToBuffer(float[] a)

Here you can find the source of floatToBuffer(float[] a)

Description

float To Buffer

Declaration

public static FloatBuffer floatToBuffer(float[] a) 

Method Source Code

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

public class Main {
    public static FloatBuffer floatToBuffer(float[] a) {
        ByteBuffer mbb = ByteBuffer.allocateDirect(a.length * 4);
        mbb.order(ByteOrder.nativeOrder());
        FloatBuffer fBuffer = mbb.asFloatBuffer();
        fBuffer.put(a);/*from  ww w. j av  a2  s. co  m*/
        fBuffer.position(0);
        return fBuffer;
    }
}

Related

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