Java tutorial
//package com.java2s; public class Main { public static byte[] combine(byte[]... bs) { int length = 0; for (byte[] b : bs) { length += b.length; } byte[] rt = new byte[length]; length = 0; for (byte[] b : bs) { System.arraycopy(b, 0, rt, length, b.length); length += b.length; } return rt; } }