Here you can find the source of bitSetToString(BitSet bits, int length)
Parameter | Description |
---|---|
bits | a parameter |
length | a parameter |
public static String bitSetToString(BitSet bits, int length)
//package com.java2s; //License from project: Open Source License import java.util.BitSet; public class Main { /**//from w ww . j ava 2s . co m * Converts a BitSet to String * @param bits * @param length * @return */ public static String bitSetToString(BitSet bits, int length) { String sbits = ""; for (int i = length - 1; i >= 0; i--) sbits += (bits.get(i) ? "1" : "0"); return sbits; } }