Here you can find the source of isBitSet(int b, int bit)
public static boolean isBitSet(int b, int bit)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean isBitSet(byte b, int bit) { if (bit < 0 || bit >= 8) return false; return (b & (1 << bit)) > 0; }/* ww w . j a v a 2 s. c om*/ public static boolean isBitSet(int b, int bit) { if (bit < 0 || bit >= 32) return false; return (b & (1 << bit)) > 0; } }