Android Array Clone clone(byte[] data)

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

Description

clone

License

Open Source License

Declaration

public static byte[] clone(byte[] 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 2s  .  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(T[] array)
  2. clone(boolean[] array)
  3. clone(byte[] array)
  4. clone(char[] array)
  5. clone(double[] array)
  6. clone(float[] array)
  7. clone(int[] array)