Here you can find the source of toBinaryString(boolean[] array)
public static String toBinaryString(boolean[] array)
//package com.java2s; /**//from w ww . j av a 2 s.c om * A simple class comprised of various tools used in handling of boolean arrays and values. * * @author Raymond Berg www.rwberg.org * * Use is made available under the Creative Commons License. * Feel free to use but leave attribution to original author throughout use. */ public class Main { public static String toBinaryString(boolean[] array) { char[] rawArr = new char[array.length]; for (int i = 0; i < rawArr.length; i++) { rawArr[i] = toBinaryChar(array[i]); } return new String(rawArr); } public static char toBinaryChar(boolean bit) { return bit ? '1' : '0'; } }