Here you can find the source of bitFieldToString(boolean[] bits)
Parameter | Description |
---|
public static String bitFieldToString(boolean[] bits)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w .j a v a 2 s .c om*/ * Converts a bitfield into a string. * @param boolean[] bits * @return String bitfield string representation. */ public static String bitFieldToString(boolean[] bits) { String bitfield = ""; for (int i = 0; i < bits.length; ++i) { if (bits[i]) { bitfield += "1"; } else { bitfield += "0"; } } return bitfield; } }