Here you can find the source of merge(byte[] src, byte[] src2, int start, int length)
public static byte[] merge(byte[] src, byte[] src2, int start, int length)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] merge(byte[] src, byte[] src2, int start, int length) { byte[] dest = new byte[src.length + length]; System.arraycopy(src, 0, dest, 0, src.length); System.arraycopy(src2, start, dest, src.length, length); return dest; }//from w ww .j ava2s. c om public static byte[] merge(byte[]... src) { if (src == null || src.length == 0) { return null; } int len = src.length; if (len > 1) { int length = 0; for (int i = 0; i < len; i++) { length += src[i].length; } byte[] dest = new byte[length]; length = 0; for (int i = 0; i < len; i++) { byte[] sbyte = src[i]; System.arraycopy(sbyte, 0, dest, length, sbyte.length); length += sbyte.length; } return dest; } return src[0]; } }