Java tutorial
//package com.java2s; public class Main { /** * Creates duplicate of given array * * @param src The array to duplicate. * @return A copy of the array. */ public static byte[] duplicate(final byte[] src) { final byte[] result = new byte[src.length]; System.arraycopy(src, 0, result, 0, src.length); return result; } }