Here you can find the source of toIntBuffer(int[] array)
public static IntBuffer toIntBuffer(int[] array)
//package com.java2s; //License from project: Apache License import java.nio.*; public class Main { public static IntBuffer toIntBuffer(int[] array) { ByteBuffer bb = ByteBuffer.allocateDirect(array.length << 2); bb.order(ByteOrder.nativeOrder()); bb.position(0);/* w w w.j a v a2s.co m*/ IntBuffer ibb = bb.asIntBuffer(); ibb.put(array); return ibb; } }