Java BigInteger Calculate clone(BigInteger[] data)

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

Description

clone

License

Apache License

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.math.BigInteger;

public class Main {
    public static byte[] clone(byte[] data) {
        if (data == null) {
            return null;
        }/*from w w  w  . j  av a 2s.  c  om*/
        byte[] copy = new byte[data.length];

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

        return copy;
    }

    public static byte[][] clone(byte[][] data) {
        if (data == null) {
            return null;
        }

        byte[][] copy = new byte[data.length][];

        for (int i = 0; i != copy.length; i++) {
            copy[i] = clone(data[i]);
        }

        return copy;
    }

    public static byte[][][] clone(byte[][][] data) {
        if (data == null) {
            return null;
        }

        byte[][][] copy = new byte[data.length][][];

        for (int i = 0; i != copy.length; i++) {
            copy[i] = clone(data[i]);
        }

        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;
    }

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

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

        return copy;
    }

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

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

        return copy;
    }
}

Related

  1. calculateGx(BigInteger p, BigInteger g, BigInteger x)
  2. calculateRx_(BigInteger Rx, BigInteger n)
  3. castToBigInteger(Object val)
  4. chop(BigInteger in, int bits)
  5. clip(BigInteger bi, int numberOfBytes)
  6. copy_into_byte_array(BigInteger bi, byte[] a)
  7. copyOf(BigInteger[] data, int newLength)
  8. copyOfRange(BigInteger[] data, int from, int to)
  9. createUnsignedBigInteger(byte[] data)