Here you can find the source of booleanToByte(boolean[] bool)
static byte[] booleanToByte(boolean[] bool)
//package com.java2s; public class Main { /** Convert an array of booleans to bytes */ static byte[] booleanToByte(boolean[] bool) { byte[] byt = new byte[bool.length]; for (int i = 0; i < bool.length; i += 1) { byt[i] = bool[i] ? (byte) 'T' : (byte) 'F'; }/*from w w w . ja v a 2 s. co m*/ return byt; } }