Here you can find the source of clone(byte[][] im)
public static byte[][] clone(byte[][] im)
//package com.java2s; //License from project: Apache License public class Main { public static byte[][] clone(byte[][] im) { byte[][] clone = new byte[im.length][im[0].length]; copy(clone, im);//from w w w . j ava 2 s . co m return clone; } public static void copy(byte[][] target, byte[][] src) { for (int y = 0; y < target.length; y++) { for (int x = 0; x < target[0].length; x++) { target[y][x] = src[y][x]; } } } }