Java examples for java.util:BitSet
BitSet to Binary String
//package com.java2s; import java.util.BitSet; public class Main { public static String toBinaryString(BitSet bs) { StringBuilder sb = new StringBuilder(bs.length()); for (int i = bs.length() - 1; i >= 0; i--) sb.append(bs.get(i) ? 1 : 0); return sb.toString(); }/*from ww w .j ava 2s . c o m*/ }