Java BigInteger to convertAllElementsToLong(P bigIntegers)

Here you can find the source of convertAllElementsToLong(P bigIntegers)

Description

convert All Elements To Long

License

Open Source License

Declaration

public static <P extends Collection<BigInteger>> List<Long> convertAllElementsToLong(P bigIntegers) 

Method Source Code


//package com.java2s;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class Main {
    public static <P extends Collection<BigInteger>> List<Long> convertAllElementsToLong(P bigIntegers) {
        if (bigIntegers == null) {
            return null;
        }/*  w  ww  .j  a  v a2 s  . co m*/
        try {
            ArrayList<Long> results = new ArrayList<Long>();
            for (BigInteger bigInteger : bigIntegers) {
                results.add(bigInteger.longValue());
            }
            return results;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. bigIntToSortableBytes(BigInteger bigInt, int bigIntSize, byte[] result, int offset)
  2. biToHex(BigInteger bi)
  3. byteConvert32Bytes(BigInteger n)
  4. concat(BigInteger left, BigInteger right)
  5. convert(BigInteger value, int base, boolean extra)
  6. convertBigIntegerIntoInetAddress(final BigInteger i)
  7. convertBigIntegerToNBytes( final BigInteger bigInteger, final int numBytes)
  8. convertPositive(BigInteger bi)
  9. convertRealNumberBits(BigInteger source, int size, int direction)