Here you can find the source of addArrayAll(byte[] array1, byte[] array2)
public static byte[] addArrayAll(byte[] array1, byte[] array2)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] addArrayAll(byte[] array1, byte[] array2) { if (array1 == null) return clone(array2); if (array2 == null) { return clone(array1); }//from w w w . java 2 s. c o m byte[] joinedArray = new byte[array1.length + array2.length]; System.arraycopy(array1, 0, joinedArray, 0, array1.length); System.arraycopy(array2, 0, joinedArray, array1.length, array2.length); return joinedArray; } private static byte[] clone(byte[] array) { if (array == null) { return null; } return (byte[]) array.clone(); } }