Here you can find the source of arraycopyAndInsertInt(final int[] src, final int idx, final int value)
static int[] arraycopyAndInsertInt(final int[] src, final int idx, final int value)
//package com.java2s; //License from project: Open Source License public class Main { static int[] arraycopyAndInsertInt(final int[] src, final int idx, final int value) { final int[] dst = new int[src.length + 1]; // copy 'src' and insert 1 element(s) at position 'idx' System.arraycopy(src, 0, dst, 0, idx); dst[idx] = value;/*from w ww .j av a 2s . c o m*/ System.arraycopy(src, idx, dst, idx + 1, src.length - idx); return dst; } }