Here you can find the source of addByteArrays(byte[] array1, byte[] array2)
public static byte[] addByteArrays(byte[] array1, byte[] array2)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] addByteArrays(byte[] array1, byte[] array2) { byte[] concatenatedArray = new byte[array1.length + array2.length]; System.arraycopy(array1, 0, concatenatedArray, 0, array1.length); System.arraycopy(array2, 0, concatenatedArray, array1.length, array2.length); return concatenatedArray; }/*from ww w . j a va 2 s . c o m*/ }