Binary to text in Java

You can use Integer.parseInt with a radix of 2 (binary) to convert the binary string to an integer:

int charCode = Integer.parseInt(info, 2);

Then if you want the corresponding character as a string:

String str = new Character((char)charCode).toString();

Leave a Comment