public static boolean [ ] toBinary ( int number , int length ) { final boolean [ ] binary = new boolean [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { binary [ length - 1 - i ] = ( 1 << i & number ) != 0 ; } return binary ; }
Convert number to binary array representation .