Java Integer to Boolean intToBoolAra(int num, int len)

Here you can find the source of intToBoolAra(int num, int len)

Description

int To Bool Ara

License

Open Source License

Declaration

public static final boolean[] intToBoolAra(int num, int len) 

Method Source Code

//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;
    }
}

Related

  1. IntegerToboolean(final Integer value)
  2. integerToStrBool(Integer integer)
  3. IntToBool(int Expression)
  4. intToBool(int i)
  5. intToBool(int int_in, int length)
  6. intToBoolean(int x)
  7. intToBoolean(int[] values)
  8. intToBoolean(Integer value)
  9. intToBooleanArray(int in)