Java FloatBuffer Create createFloatBuffer(int size)

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

Description

create Float Buffer

License

LGPL

Declaration

public static FloatBuffer createFloatBuffer(int size) 

Method Source Code


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

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

public class Main {
    public static FloatBuffer createFloatBuffer(int size) {
        return createByteBuffer(size << 2).asFloatBuffer();
    }/*from   w  w  w .j  ava 2s .co  m*/

    public static synchronized ByteBuffer createByteBuffer(int size) {
        return ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
    }
}

Related

  1. createFloatBuffer(float[] array)
  2. createFloatBuffer(FloatBuffer buffer)
  3. createFloatBuffer(int limit)
  4. createFloatBuffer(int numFloats)
  5. createFloatBufferOnHeap(final int size)
  6. newFloatBuffer(final int theSize)
  7. newFloatBuffer(int len)
  8. newFloatBuffer(int numFloats)