# Re: decode binary to characters

• 11-18-2013, 01:08 AM
jasmeet
How to convert Binary
Quote:

Originally Posted by Eranga
Yeah, step down your problem first of all and solve them step by step. I think you get enough comments on conversion you want. If you go through them carefully it's possible to find the solution. So give a try from the first step and let us know if you stuck with any. Your effort make a real change lol.

Hi, I would just like to add another query in this thread.
What would be the algorithm to convert Base 2 values without a space to their actual characters?
Example: Input Base 2(ascii) : 01001001001000000110110001101001011010110110010100 10000001001010010000010101011001000001
Output : I like JAVA

How it would take 8 bits (or 16 bits) at a time and convert it to corresponding character?

Thanks!

What would be the algorithm to convert Base 2 to their actual characters?
Example: Input Base 2 : 01001001001000000110110001101001011010110110010100 10000001001010010000010101011001000001
Output : I like JAVA

How it would take 8 bits (or 16 bits) at a time and convert it to corresponding character?

Thanks!
• 11-18-2013, 01:15 AM
Norm
Re: decode binary to characters
Quote:

How it would take 8 bits (or 16 bits) at a time
Is the input a String of "0" and "1" characters representing bits? The substring() method can get the characters in any sized String that you want. Then the Integer class has methods for converting Strings to numbers.
• 11-18-2013, 01:36 AM
jasmeet
How to convert Binary to Character
What would be the algorithm to convert Base 2 to their actual characters?
Example: Input Base 2 : 01001001001000000110110001101001011010110110010100 10000001001010010000010101011001000001
Output : I like JAVA

How it would take 8 bits (or 16 bits) at a time and convert it to corresponding character?

Thanks!
• 11-18-2013, 02:44 AM
Norm
Re: decode binary to characters
Why post the this 3 times?