I have a very large string ( 64 characters) containing 1s and 0s. sample - 1001111111101010011101101011100101001010111000101111011110001000
All I want is to convert it into BitSet var containing the 1s and 0s in same positions I am using the function -
private static BitSet fromString(String binary) {
return BitSet.valueOf(new long[] { Long.parseLong(binary, 2) });
}
and have already gone through - Java BitSet Example I have actually figured out the issue and that is my 64th bit being 1 and the function throwing up a number format exception I have tried plethora of other conversions but can't get it working Any help here would be appreciated Thanks!!!