Here you can find the source of ToBigInteger(BitSet bs)
Parameter | Description |
---|---|
bs | The bitset. |
public static BigInteger ToBigInteger(BitSet bs)
//package com.java2s; //License from project: Open Source License import java.util.*; import java.math.*; public class Main { /**/*from ww w.j a va2s . c o m*/ * Convert a bitset to a BigInteger. * * @param bs The bitset. * * @return the corresponding BigInteger. */ public static BigInteger ToBigInteger(BitSet bs) { BigInteger value = BigInteger.ZERO; for (int i = 0; i < bs.length(); i += 1) { if (bs.get(i)) value = value.setBit(i); } return value; } }