Here you can find the source of booleanToLong(boolean[] values)
public static long[] booleanToLong(boolean[] values)
//package com.java2s; public class Main { public static long[] booleanToLong(boolean[] values) { if (values == null) { return null; }/*from www .ja v a2 s.co m*/ long[] results = new long[values.length]; for (int i = 0; i < values.length; i++) { results[i] = (values[i] == true ? 1 : 0); } return results; } }