Here you can find the source of addArray(int[] a, int[] b)
private static int[] addArray(int[] a, int[] b)
//package com.java2s; //License from project: Open Source License public class Main { private static int[] addArray(int[] a, int[] b) { int[] result = null; if (a != null && b != null) { result = new int[a.length + b.length]; System.arraycopy(a, 0, result, 0, a.length); System.arraycopy(b, 0, result, a.length, b.length); } else {//from w ww .j a va 2 s.c om if (b != null) return b; if (a != null) return a; } return result; } }