Here you can find the source of copyByteArray(byte[] source)
public static byte[] copyByteArray(byte[] source)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] copyByteArray(byte[] source) { byte[] buf = new byte[source.length]; System.arraycopy(source, 0, buf, 0, buf.length); return buf; }/*from w ww . j a v a2 s . c o m*/ }