Here you can find the source of createIntBuffer(int[] array)
public static IntBuffer createIntBuffer(int[] array)
//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; } }