Here you can find the source of fromInt(int x, int size)
public static boolean[] fromInt(int x, int size)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean[] fromInt(int x, int size) { boolean[] res = new boolean[size]; for (int i = 0; i < size; i++) { res[i] = (x & (1 << size - i - 1)) != 0; }// w ww . j a va2s . co m return res; } }