Here you can find the source of bitSet2String(final BitSet bs)
public static String bitSet2String(final BitSet bs)
//package com.java2s; //License from project: Open Source License import java.util.BitSet; public class Main { public static String bitSet2String(final BitSet bs) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < bs.length(); ++i) { final char ch = bs.get(bs.length() - i) ? '1' : '0'; sb.append(ch);/*from w w w . j ava 2 s. c o m*/ } return sb.toString(); } }