Java Array Copy copyIntoBigger(int[] array, int newSize, int defaultValue)

Here you can find the source of copyIntoBigger(int[] array, int newSize, int defaultValue)

Description

copy Into Bigger

License

Open Source License

Declaration

public static final int[] copyIntoBigger(int[] array, int newSize, int defaultValue) 

Method Source Code

//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
}

Related

  1. copyArrayToStr(String[] src, String del)
  2. copyArrayWhenNotNull(byte[] source)
  3. copyBytes(byte[] data, int from, int to)
  4. copyExcept(E[] orig, E excludedElem)
  5. copyIfExceeded(int[] arr, int len)
  6. copyOf(boolean[] t)
  7. copyOf(final U[] original, final int newLength, final Class newType)
  8. copyOf(T[] array)
  9. copyOf(T[] array, int count)