Here you can find the source of toBinaryBoolean(boolean source)
public static byte[] toBinaryBoolean(boolean source)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] toBinaryBoolean(boolean source) { return new byte[] { (byte) (source ? 0x01 : 0x00) }; }/* ww w .jav a2 s . co m*/ }