Android FloatBuffer Create ConvToFloatBuffer(float buf[])

Here you can find the source of ConvToFloatBuffer(float buf[])

Description

Conv To Float Buffer

Declaration

public static FloatBuffer ConvToFloatBuffer(float buf[]) 

Method Source Code

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

public class Main {
    public static FloatBuffer ConvToFloatBuffer(float buf[]) {
        FloatBuffer ReturnBuffer;

        ByteBuffer vbb = ByteBuffer.allocateDirect(buf.length * 4);
        vbb.order(ByteOrder.nativeOrder());
        ReturnBuffer = vbb.asFloatBuffer();
        ReturnBuffer.put(buf);/*from   w  w w.  java  2s  . co m*/
        ReturnBuffer.position(0);

        return ReturnBuffer;
    }
}

Related

  1. wrap(float[] buffer)
  2. makeFloatBuffer(float[] array)
  3. makeFloatBuffer(float[][] array, int rows, int cols)
  4. makeFloatBuffer(int length)
  5. ConvToFloatBuffer(float buf[])
  6. makeFloatBuffer(float[] arr)
  7. makeFloatBuffer(float[] i_arr)
  8. makeFloatBuffer(int i_len)