Java tutorial
//package com.java2s; public class Main { public static byte[] appendByteArray(byte[] src, byte[] data) { if (src.length <= 0 || data.length <= 0) { throw new IllegalArgumentException("\u5b57\u8282\u6570\u7ec4\u53c2\u6570\u9519\u8bef"); } byte[] ret = new byte[(src.length + data.length)]; System.arraycopy(src, 0, ret, 0, src.length); System.arraycopy(data, 0, ret, src.length, data.length); return ret; } }