Java BitSet to bitSetToLong(BitSet set)

Here you can find the source of bitSetToLong(BitSet set)

Description

bit Set To Long

License

Open Source License

Declaration

public static long bitSetToLong(BitSet set) 

Method Source Code

//package com.java2s;

import java.util.BitSet;

public class Main {
    public static long bitSetToLong(BitSet set) {
        int max = set.length();
        long bits = 0;
        for (int count = 0; count < max; count++) {
            if (set.get(count))
                bits |= (1L << count);
        }//from  ww  w  .  j  a v a 2 s  . c o m
        return bits;
    }
}

Related

  1. bitSet2extendedByte(BitSet b)
  2. bitSet2Int(BitSet bs)
  3. bitsetToDoubleArray(BitSet bs, int n)
  4. bitsetToIndices(BitSet bits)
  5. bitSetToInt(final BitSet bitSet)
  6. bitSetToMap(Map map, String key, BitSet bits, int length)
  7. bitSetToUnsignedInt(BitSet b, int startBit, int length)
  8. bitsToBytes(BitSet ba, int size)
  9. BitsToBytes(BitSet bits)