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