Here you can find the source of intToBooleanArray(int in)
Parameter | Description |
---|---|
in | a parameter |
public static boolean[] intToBooleanArray(int in)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w .j a v a 2s. com*/ * convet an int into an array of 32 booleans * 1 per bit * @param in * @return */ public static boolean[] intToBooleanArray(int in) { boolean[] ret = new boolean[32]; int index = 1; for (int i = 0; i < ret.length; i++) { if ((in & index) != 0) ret[i] = true; index <<= 1; } return ret; } }