Java IntBuffer Create createIntBuffer(int[] array)

Here you can find the source of createIntBuffer(int[] array)

Description

create Int Buffer

License

Open Source License

Declaration

public static IntBuffer createIntBuffer(int[] array) 

Method Source Code


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

import java.nio.IntBuffer;

public class Main {
    public static IntBuffer createIntBuffer(int[] array) {
        IntBuffer result = ByteBuffer.allocateDirect(array.length << 2).order(ByteOrder.nativeOrder())
                .asIntBuffer();// w  w w .  j a va  2s. c  om
        result.put(array).flip();
        return result;
    }
}

Related

  1. createIntBuffer(int capacity)
  2. createIntBuffer(int size)
  3. createIntBuffer(int size)
  4. createIntBuffer(int size)
  5. createIntBuffer(int... data)
  6. createIntBufferOnHeap(final int size)
  7. newDirectIntBuffer(final int theSize)
  8. newDirectIntBuffer(final int theSize)