List of utility methods to do Array Copy
char[] | arrayCopy(char[] chars) array Copy if (chars == null) return null; char[] copy = new char[chars.length]; System.arraycopy(chars, 0, copy, 0, chars.length); return copy; |
double[][] | arrayCopy(double[][] src) Copies all rows and columns between two double arrays double[][] dest = new double[src.length][]; for (int r = 0; r < src.length; r++) { dest[r] = new double[src[r].length]; System.arraycopy(src[r], 0, dest[r], 0, src[r].length); return dest; |
void | arrayCopy(final byte[] src, final byte[] dest) Copy array with zero offsets. System.arraycopy(src, 0, dest, 0, src.length); |
float[] | arrayCopy(final float[] arrayToCopy) Copy an array. return Arrays.copyOf(arrayToCopy, arrayToCopy.length);
|
int[] | arrayCopy(int[] array, int i0, int n, boolean isReverse) array Copy if (array == null) return null; int oldLength = array.length; if (n == -1) n = oldLength; if (n == -2) n = oldLength / 2; n = n - i0; ... |
int[] | arrayCopy(int[] array, int length) Copy an array into a new array with the given length. int[] result = new int[length]; length = Math.min(array.length, length); System.arraycopy(array, 0, result, 0, length); return result; |
int[] | arrayCopy(int[] x) array Copy int z = 0; int[] l = new int[x.length + 1]; for (int i = 0; i < x.length; i++) { int y = x[i]; if (y != 0) { l[z] = y; z++; int[] n = new int[z]; System.arraycopy(l, 0, n, 0, z); return n; |
void | arrayCopy(int[][] source, int[][] destination) array Copy for (int a = 0; a < source.length; a++) { System.arraycopy(source[a], 0, destination[a], 0, source[a].length); |
void | arraycopy(long src[], int srcOffset, long dest[], int destOffset, int limit) arraycopy if (src == dest) { if (srcOffset == destOffset) { return; if (destOffset > srcOffset && destOffset < srcOffset + limit) { limit--; srcOffset += limit; destOffset += limit; ... |
void | arraycopy(long[] src, int srcPos, long[] dest, int destPos, int length) arraycopy for (int i = 0; i < length; i++) { dest[destPos + i] = src[srcPos + i]; |