Java FloatBuffer Create newNativeFloatBuffer(int size)

Here you can find the source of newNativeFloatBuffer(int size)

Description

new Native Float Buffer

License

BSD License

Declaration

public static FloatBuffer newNativeFloatBuffer(int size) 

Method Source Code

//package com.java2s;
//License from project: BSD License 

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;

public class Main {
    public static FloatBuffer newNativeFloatBuffer(int size) {
        FloatBuffer buff = ByteBuffer.allocateDirect(size * Float.SIZE).order(ByteOrder.nativeOrder())
                .asFloatBuffer();//from  w  ww . j  ava2s  .c  o m
        return buff;
    }
}

Related

  1. createFloatBuffer(int size)
  2. createFloatBufferOnHeap(final int size)
  3. newFloatBuffer(final int theSize)
  4. newFloatBuffer(int len)
  5. newFloatBuffer(int numFloats)
  6. toFloatBuffer(float[] array)