Here you can find the source of toIntArray(final BitSet bits, final int size)
public static int[] toIntArray(final BitSet bits, final int size)
//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; } }