Here you can find the source of booleanToInt(boolean[] values)
public static int[] booleanToInt(boolean[] values)
//package com.java2s; public class Main { public static int[] booleanToInt(boolean[] values) { if (values == null) { return null; }// www .ja va2s . c o m int[] results = new int[values.length]; for (int i = 0; i < values.length; i++) { results[i] = (values[i] == true ? 1 : 0); } return results; } }