Here you can find the source of copyIntoBigger(int[] array, int newSize, int defaultValue)
public static final int[] copyIntoBigger(int[] array, int newSize, int defaultValue)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static final int[] copyIntoBigger(int[] array, int newSize, int defaultValue) { assert newSize > array.length; int[] bigger = Arrays.copyOf(array, newSize); Arrays.fill(bigger, array.length, newSize, defaultValue); return bigger; }//ww w . jav a 2 s .c o m }