Here you can find the source of concatArrays(final byte[] arr1, final byte[] arr2)
Parameter | Description |
---|---|
arr1 | Array1 |
arr2 | Array2 |
public static byte[] concatArrays(final byte[] arr1, final byte[] arr2)
//package com.java2s; public class Main { /**//from w w w.ja va 2 s. co m * Concatenate arrays. * * @param arr1 * Array1 * @param arr2 * Array2 * @return [Array1] + []Array2] */ public static byte[] concatArrays(final byte[] arr1, final byte[] arr2) { final byte result[] = new byte[arr1.length + arr2.length]; System.arraycopy(arr1, 0, result, 0, arr1.length); System.arraycopy(arr2, 0, result, arr1.length, arr2.length); return result; } }