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