Here you can find the source of createIntBuffer(int size)
public static IntBuffer createIntBuffer(int size)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; public class Main { public static IntBuffer createIntBuffer(int size) { return createByteBuffer(size * Integer.BYTES).asIntBuffer(); }/*from w w w. jav a 2 s . co m*/ public static IntBuffer createIntBuffer(int[] indices, boolean flipped) { IntBuffer buffer = createIntBuffer(indices.length); buffer.put(indices); if (flipped) buffer.flip(); return buffer; } public static ByteBuffer createByteBuffer(int size) { return ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder()); } }