Here you can find the source of concatArray(byte[] old1, byte[] old2)
private static byte[] concatArray(byte[] old1, byte[] old2)
//package com.java2s; //License from project: Apache License public class Main { private static byte[] concatArray(byte[] old1, byte[] old2) { byte[] newArray = new byte[old1.length + old2.length]; System.arraycopy(old1, 0, newArray, 0, old1.length); System.arraycopy(old2, 0, newArray, old1.length, old2.length); return newArray; }//from w w w. j a va 2 s . c om }