I am looking for an efficient way how to easily convert a BitSet to a binary string. Let us say that its usual length would be thousands of bits.
BitSet
For ex
String bitsStr = String.format("%8s", Integer.toBinaryString(bits.toByteArray()[0] & 0xFF)).replace(' ', '0');