public int getUnsetBits ( int batchSize , boolean [ ] vector , int offset ) throws IOException { int count = 0 ; for ( int i = offset ; i < batchSize + offset ; i ++ ) { vector [ i ] = ! nextBit ( ) ; count += vector [ i ] ? 1 : 0 ; } return count ; }
Sets the vector element to true for the batchSize number of elements starting at offset if the bit is not set .