Here you can find the source of booleanToBit(boolean b)
public static byte booleanToBit(boolean b)
//package com.java2s; //License from project: Open Source License public class Main { public static byte booleanToBit(boolean b) { if (b)//from w w w. j av a 2 s. co m return 1; else return 0; } }