private static void arraycopy(long[] src, int srcPos, long[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 3); }
private static void arraycopy(byte[] src, int srcPos, byte[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 0); }
private static void arraycopy(char[] src, int srcPos, char[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 1); }
private static void arraycopy(double[] src, int srcPos, double[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 3); }
private static void arraycopy(float[] src, int srcPos, float[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 2); }
private static void arraycopy(int[] src, int srcPos, int[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 2); }
private static void arraycopy(short[] src, int srcPos, short[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 1); }
private static void arraycopy(boolean[] src, int srcPos, boolean[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 0); }
private static void arraycopy(Object[] src, int srcPos, Object[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); if (length > 0) { // TODO: Use arraycopyFast() if src.class and dst.class have same dimensionality and (src instanceof dst) int i = 0; try { // Check if this is a forward or backwards arraycopy if (src != dst || srcPos > dstPos || srcPos + length <= dstPos) { for (i = 0; i < length; ++i) { dst[dstPos + i] = src[srcPos + i]; } } else { for (i = length - 1; i >= 0; --i) { dst[dstPos + i] = src[srcPos + i]; } } } catch (ArrayStoreException e) { // Throw a new one with a more descriptive message. Class<?> srcElemClass = src[i + srcPos].getClass(); String srcElemTypeName = srcElemClass.isArray() ? srcElemClass.getCanonicalName() : srcElemClass.getName(); throw new ArrayStoreException(String.format( "source[%d] of type %s cannot be stored in destination array of type %s", i + srcPos, srcElemTypeName, dst.getClass().getCanonicalName())); } } }
private static void arraycopy(byte[] src, int srcPos, byte[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 0); }
private static void arraycopy(char[] src, int srcPos, char[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 1); }
private static void arraycopy(double[] src, int srcPos, double[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 3); }
private static void arraycopy(float[] src, int srcPos, float[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 2); }
private static void arraycopy(boolean[] src, int srcPos, boolean[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 0); }
private static void arraycopy(double[] src, int srcPos, double[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 3); }
private static void arraycopy(long[] src, int srcPos, long[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 3); }
private static void arraycopy(char[] src, int srcPos, char[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 1); }
private static void arraycopy(float[] src, int srcPos, float[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 2); }
private static void arraycopy(int[] src, int srcPos, int[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 2); }
private static void arraycopy(char[] src, int srcPos, char[] dst, int dstPos, int length) { arraycopyCheckBounds(src.length, srcPos, dst.length, dstPos, length); arraycopyFast(src, srcPos, dst, dstPos, length, 1); }