Android examples for java.nio:IntBuffer
create IntBuffer by size
import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; public class Main{ public static final IntBuffer createIntBuffer(int size) { return ByteBuffer .allocateDirect(size * DatatypeUtils.INTEGER_SIZE_BYTES) .order(ByteOrder.nativeOrder()).asIntBuffer(); }// w ww . ja va 2s.c o m }