Java Array Copy arrayBig2Small(int[] big, int bigWidth, int[][] small, int startRow, int startCol, int endRow, int endCol)

Here you can find the source of arrayBig2Small(int[] big, int bigWidth, int[][] small, int startRow, int startCol, int endRow, int endCol)

Description

array Big Small

License

Open Source License

Declaration

public static void arrayBig2Small(int[] big, int bigWidth, int[][] small, int startRow, int startCol,
            int endRow, int endCol) 

Method Source Code

//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);
        }
    }
}

Related

  1. arrayCopy(byte[] dest, int offset, byte[] in)
  2. arrayCopy(byte[] in, int inOff, int length, byte[] out, int outOff)
  3. arrayCopy(byte[] source, byte[] dest)
  4. arrayCopy(byte[] source, byte[] dest)