Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static byte[] appendArrays(byte[]... arrays) { byte[] retArr = new byte[0]; int pos = 0; for (byte[] arr : arrays) { pos = retArr.length; retArr = Arrays.copyOf(retArr, retArr.length + arr.length); for (int idx = 0; idx < retArr.length; idx++) { retArr[pos + idx] = arr[idx]; } } return retArr; } }