Added copyTo method to Java arrays