• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Ascii to binary and binary to ascii

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic