Here you can find the source of booleanToChar(boolean[] values)
public static char[] booleanToChar(boolean[] values)
//package com.java2s; public class Main { public static char[] booleanToChar(boolean[] values) { if (values == null) { return null; }//from ww w .ja va 2 s.c om char[] results = new char[values.length]; for (int i = 0; i < values.length; i++) { results[i] = (values[i] == true ? '1' : '0'); } return results; } }