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