Here you can find the source of arrayDuplicate(byte[] in)
static public byte[] arrayDuplicate(byte[] in)
//package com.java2s; //License from project: Open Source License public class Main { static public byte[] arrayDuplicate(byte[] in) { byte[] out = new byte[in.length]; arrayCopy(out, 0, in);/*from ww w . j ava 2 s . com*/ return out; } static public void arrayCopy(byte[] dest, int offset, byte[] in) { System.arraycopy(in, 0, dest, offset, in.length); } }