I have a large binary string "101101110 ..." and I'm trying to store it in an array of bytes. What is the best way to do this?
Let's say I have largeString = "0100111010111011011000000001000110101"
The result I'm looking for:
[78, 187, 96, 17, 21]
01001110 10111011 01100000 00010001 10101
What I tried:
byte[] b= new BigInteger(largeString,2).toByteArray();
however, he did not give me the result that I am looking for ...
Lynct source share