How do I convert a String written as Binary, to binary (in byte array)?
If I have a String:
String binary = "0000"
I want the binary data to be 0000
.
below is what happens when I set the binary to a byte array (which in turn returns 48, which is ASCII)
Binary String: 0000
Binary Byte array: 48
Binary Byte array: 48
Binary Byte array: 48
Binary Byte array: 48
I'm not good at explaining so hopefully the above example was enough to tell you what I want.
EDIT: This is to set the data into a binary file.