Here you can find the source of copyBytes(byte[] src)
public static byte[] copyBytes(byte[] src)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] copyBytes(byte[] src) { byte[] copy = new byte[src.length]; for (int i = 0; i < src.length; i++) { copy[i] = src[i];// w w w .j a v a2 s . c o m } return copy; } }