Here you can find the source of arrayBig2Small(int[] big, int bigWidth, int[][] small, int startRow, int startCol, int endRow, int endCol)
public static void arrayBig2Small(int[] big, int bigWidth, int[][] small, int startRow, int startCol, int endRow, int endCol)
//package com.java2s; /* ArrayUtil.java 1.0 2010-2-2 * /* www . j a v a 2 s . c o m*/ * Copyright (c) 2010 by Chen Zhiwu * All rights reserved. * * The copyright of this software is own by the authors. * You may not use, copy or modify this software, except * in accordance with the license agreement you entered into * with the copyright holders. For details see accompanying license * terms. */ public class Main { public static void arrayBig2Small(int[] big, int bigWidth, int[][] small, int startRow, int startCol, int endRow, int endCol) { int j = 0; for (int i = startRow; i <= endRow; i++, j++) { // int a = i * bigWidth + startCol; // int b = j * small[0].length; // int c = small[0].length; // int d = small.length; System.arraycopy(big, i * bigWidth + startCol, small[j], 0, endCol - startCol + 1); } } }