Here you can find the source of intToBoolAra(int num, int len)
public static final boolean[] intToBoolAra(int num, int len)
//package com.java2s; //License from project: Open Source License public class Main { public static final boolean[] intToBoolAra(int num, int len) { boolean[] bool = new boolean[len]; int val = num; int pos = len; do {//w ww . ja va 2 s . co m bool[--pos] = (val & 1) == 1; val >>>= 1; } while (val > 0 && pos > 0); return bool; } }