Here you can find the source of combine(final byte[] array1, final byte[] array2)
public static byte[] combine(final byte[] array1, final byte[] array2)
//package com.java2s; // it under the terms of the GNU General Public License as published by public class Main { public static byte[] combine(final byte[] array1, final byte[] array2) { if (array1 == null) return copy(array2); else if (array2 == null) return copy(array1); final 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; }/*w w w. j ava2s . c om*/ public static byte[] copy(final byte[] array) { if (array == null) return null; return array.clone(); } }