• Post Reply Bookmark Topic Watch Topic
  • New Topic

Ascii to binary and binary to ascii  RSS feed

 
J amodi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anyone help me out , how do I get ascii to binary and binary to ascii in java ?

Thanks.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly do you mean? ASCII is binary.

Please TellTheDetails(⇐click) about what you're trying to do, and provide an example or two.
 
J amodi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a code which converts Ascii string to binary .. which is this !!



so if I give my string as "foo".. it gives me binary string as 01100110 01101111 01101111

Now, I need to convert this binary number to ascii value. How do I do this ?

Thanks.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I see what you mean now.


so if I give my string as "foo".. it gives me binary string as 01100110 01101111 01101111

Now, I need to convert this binary number to ascii value. How do I do this ?


Well, your first step, as it always is with programming, is to figure out how you would do this "manually", without Java. What are the small, simple, precise steps?
 
J amodi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sir,

I am right now in a hurry, i need to complete something asap. Will you be able to help me out with code ?

thanks
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J amodi wrote:Dear Sir,

I am right now in a hurry, i need to complete something asap.


That is not the concern of anybody here, and mentioning it will tend to drive people away, so please EaseUp.(⇐click)

Will you be able to help me out with code ?


I could, but I won't. This site is NotACodeMill.(⇐click) Giving you code doesn't help you learn, and it's unethical for somebody else to do work that is your responsibility.
 
J amodi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. Fine, could you tell me what are the steps to convert ?


 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J amodi wrote:Ok. Fine, could you tell me what are the steps to convert ?


So, if you see 01100110, you have no idea how to turn that into 'f'? That is, even if somebody just gives you "01100110", you have no idea what to do with it?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!