Here you can find the source of copyOf(final byte[] bytes)
public static byte[] copyOf(final byte[] bytes)
//package com.java2s; public class Main { public static byte[] copyOf(final byte[] bytes) { final byte[] copy = new byte[bytes.length]; System.arraycopy(bytes, 0, copy, 0, bytes.length); return copy; }//from w w w. ja v a 2 s . c o m }