Here you can find the source of isBitSet(byte b, int bit)
public static boolean isBitSet(byte 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; }/*from w w w.j a v a 2 s .c o m*/ public static boolean isBitSet(int b, int bit) { if (bit < 0 || bit >= 32) return false; return (b & (1 << bit)) > 0; } }