Android Array Clone clone(int[] data)

Here you can find the source of clone(int[] data)

Description

clone

License

Open Source License

Declaration

public static int[] clone(int[] data) 

Method Source Code

//package com.java2s;

public class Main {
    public static byte[] clone(byte[] data) {
        if (data == null) {
            return null;
        }/* w  w w  .  ja  v a 2 s  .  c  o  m*/
        byte[] copy = new byte[data.length];

        System.arraycopy(data, 0, copy, 0, data.length);

        return copy;
    }

    public static int[] clone(int[] data) {
        if (data == null) {
            return null;
        }
        int[] copy = new int[data.length];

        System.arraycopy(data, 0, copy, 0, data.length);

        return copy;
    }
}

Related

  1. clone(byte[] data)
  2. clone(char[] array)
  3. clone(double[] array)
  4. clone(float[] array)
  5. clone(int[] array)
  6. clone(long[] array)
  7. clone(short[] array)