I have a binary string containing 160 digit. I have tried:
new BigInteger("0000000000000000000000000000000000000000000000010000000000000000000000000000001000000000010000011010000000000000000000000000000000000000000000000000000000000000", 2).toByteArray() but it returns the 15 bytes array with removed leading 0 bytes.
I would like reserve those leading 0 bytes, keep it 20 bytes.
I know some other ways to accomplish that, but I would like to know is there any easier way might just need few lines of code.
8-currentSizeelements with value = 0 on the left sidebinStrand expected output?binStr = "0011010111...11"; array = {120, -145, ..., 20}.