Java tutorial
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; public class Main { public static IntBuffer getBufferFromIntArray(int[] array) { IntBuffer result = ByteBuffer.allocateDirect(array.length * 4).order(ByteOrder.nativeOrder()).asIntBuffer(); result.put(array).position(0); return result; } }