Java tutorial
//package com.java2s; public class Main { public static byte[] cloneByteArray(byte[] a) { byte[] result = new byte[a.length]; System.arraycopy(a, 0, result, 0, a.length); return result; } }