Converts a BigInteger array into an integer array - Java java.math

Java examples for java.math:BigInteger

Description

Converts a BigInteger array into an integer array

Demo Code


//package com.java2s;
import java.math.BigInteger;

public class Main {
    /**/*from ww  w  .j  av  a2 s.  com*/
     * Converts a BigInteger array into an integer array
     * 
     * @param input
     *            - the BigInteger array
     * @return the integer array
     */
    public static int[] toIntArray(BigInteger[] input) {
        int[] result = new int[input.length];
        for (int i = 0; i < input.length; i++) {
            result[i] = input[i].intValue();
        }
        return result;
    }
}

Related Tutorials