Here you can find the source of cloneBytes(byte[] buffer)
public static byte[] cloneBytes(byte[] buffer)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] cloneBytes(byte[] buffer) { byte[] ret = new byte[buffer.length]; System.arraycopy(buffer, 0, ret, 0, buffer.length); return ret; }//ww w . j a v a 2 s. c o m }