Java BitSet toIntArray(final BitSet bits, final int size)

Here you can find the source of toIntArray(final BitSet bits, final int size)

Description

to Int Array

License

Open Source License

Declaration

public static int[] toIntArray(final BitSet bits, final int size) 

Method Source Code


//package com.java2s;
import java.util.BitSet;

public class Main {
    public static int[] toIntArray(final BitSet bits, final int size) {
        final int[] array = new int[size];

        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < 32; j++) {
                if (bits.get(i * 32 + j)) {
                    array[i] |= 1 << j;
                }/* w  w  w.j  ava  2s  . com*/
            }
        }

        return array;
    }
}

Related

  1. toByteArray(BitSet bitSet)
  2. toByteArray(BitSet bs, int length)
  3. toFixedLengthByteArray(BitSet bs, int length)
  4. toggleInPlace(BitSet a, BitSet b)
  5. toInt(BitSet bitSet)
  6. toInteger(final BitSet bits)
  7. toLong(final BitSet value)
  8. toString(BitSet bs)
  9. translateBitSetToProjIndx(BitSet projBitSet)