Here you can find the source of concatArray(T[] first, T[]... rest)
public static <T> T[] concatArray(T[] first, T[]... rest)
//package com.java2s; //License from project: Apache License import java.util.Arrays; public class Main { public static <T> T[] concatArray(T[] first, T[]... rest) { int totalLength = first.length; for (T[] array : rest) { totalLength += array.length; }/*from ww w . j a v a 2s .com*/ T[] result = Arrays.copyOf(first, totalLength); int offset = first.length; for (T[] array : rest) { System.arraycopy(array, 0, result, offset, array.length); offset += array.length; } return result; } }