Here you can find the source of concat(byte[] first, byte[] second)
public static byte[] concat(byte[] first, byte[] second)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static byte[] concat(byte[] first, byte[] second) { if (first == null) return second; if (second == null) return first; byte[] result = Arrays.copyOf(first, first.length + second.length); System.arraycopy(second, 0, result, first.length, second.length); return result; }//w ww .j a v a 2s . com }