Here you can find the source of concatArrays(byte[] a, byte[] b)
public static byte[] concatArrays(byte[] a, byte[] b)
//package com.java2s; //License from project: Open Source License public class Main { private static final String ERROR_NULL_ARRAYS = "Given arrays can't be null."; public static byte[] concatArrays(byte[] a, byte[] b) { if (a == null || b == null) { throw new IllegalArgumentException(ERROR_NULL_ARRAYS); }/* www. j a v a 2s. c o m*/ byte[] concat = new byte[a.length + b.length]; for (int i = 0; i < concat.length; i++) { concat[i] = i < a.length ? a[i] : b[i - a.length]; } return concat; } }