I want to convert a 64-width binary string to long, there is a static method:
Long.parseLong(String s, int radix)
to do this, but it isn't suitable for my case.
The problem is my binary string is a machine-style long int.
For example:
1111111111111111111111111111111111111111111111111111111110000101
represents -123
, but this method recognize it as a huge positive number, this troubles me, how could I solve this problem?
Must I write a function that does the complement?