I have a char holding different characters, and I would like to print the binary value of these into two 4 bytes sections. I am adding a 1 at the beginning so that they would be 4 each.
System.out.println(1 + Integer.toString(mychar[i],2));
I am using a for loop to go through the different characters and create a table. By doing this I can get the binary value plus the one. But i don't know how to separate it into two 4 bytes.
Lets assume that mychar[i]
holds the String bryan. The output should be the following.
b 1110 0010 r 1111 0010 y 1111 1001 a 1110 0001 n 1110 1110