Here you can find the source of concatArrays(byte[]... arrays)
Parameter | Description |
---|---|
arrays | a parameter |
public static byte[] concatArrays(byte[]... arrays)
//package com.java2s; //License from project: Apache License public class Main { /**/* w ww . j a v a2 s.c o m*/ * Concatenates the given arrays in order of their occurence * @param arrays * @return */ public static byte[] concatArrays(byte[]... arrays) { int size = 0; for (byte[] cur : arrays) { if (cur == null) continue; size = size + cur.length; } byte[] out = new byte[size]; int curPos = 0; for (byte[] cur : arrays) { if (cur == null) continue; System.arraycopy(cur, 0, out, curPos, cur.length); curPos = curPos + cur.length; } return out; } }