Here you can find the source of mergeByteArrays(byte[] array1, byte[] array2)
Parameter | Description |
---|---|
array1 | a parameter |
array2 | a parameter |
public static byte[] mergeByteArrays(byte[] array1, byte[] array2)
//package com.java2s; public class Main { /**/*from w w w.jav a 2 s . c om*/ * Merges two byte arrays * @param array1 * @param array2 * @return the new merged array */ public static byte[] mergeByteArrays(byte[] array1, byte[] array2) { byte[] combined = new byte[array1.length + array2.length]; for (int i = 0; i < combined.length; ++i) { combined[i] = i < array1.length ? array1[i] : array2[i - array1.length]; } return combined; } }