There is a binary String :
String binaryString = "101101010111001011111000";
This string is of length 24, so it can be converted into 3 bytes.
The number that byte can contain is -128 to 127 but in the raw format it contains 8 bits.
Say : binary1 is 10110101 and binary2 is 01110010 and binary3 is 11111000
I want to convert this binaryString into raw bytes but when I am trying
Byte.parseByte(binary1,2);
But this method convert using int and the limit of byte ranges applies.
I want to write this binaryString to the file in form of byte.
What can be the solution to have the raw byte containing 8 bits and nothing treated like number or int ?