code: 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;
      }
docs: Convert number to binary array representation.
  
  @param number The number to convert.
  @param length The binary length.
  @return The boolean representation.