Here you can find the source of allocateInts(final int[] intarray, final int SIZE)
public static IntBuffer allocateInts(final int[] intarray, final int SIZE)
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; public class Main { public static IntBuffer allocateInts(final int howmany, final int SIZE) { return ByteBuffer.allocateDirect(howmany * SIZE).order(ByteOrder.nativeOrder()).asIntBuffer(); }//from ww w . j a v a2s . co m public static IntBuffer allocateInts(final int[] intarray, final int SIZE) { IntBuffer ib = ByteBuffer.allocateDirect(intarray.length * SIZE).order(ByteOrder.nativeOrder()) .asIntBuffer(); ib.put(intarray).flip(); return ib; } }