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