This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes binary to ascii Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "binary to ascii" Watch "binary to ascii" New topic
Author

binary to ascii

Peter Straw
Ranch Hand

Joined: Jan 08, 2002
Posts: 79
Please can you tell me the easiest way to convert a binary data from a file into ascii. I understand how to read the file using InputStream but am having difficulty converting the bytes to ascii.
Many thanks.
John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130
Peter,

First of all I think we need to confirm some terminology. When you talk about conversion of binary data to ascii, do you really mean converting a byte stream to characters?

If so, then you should probably look at the InputStreamReader class. If the byte stream you are reading uses a default character encoding, then you may consider using the FileReader class. If your byte stream uses an encoding different from the default encoding, then you would probably need to use an InputStreamReader in conjunction with a FileInputStream.

If you could provide some more details on what you're doing together with any code you have we would have a better of chance of helping you out further.

Regards,
JD
[ August 03, 2006: Message edited by: John Dell'Oso ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: binary to ascii
 
Similar Threads
Checking if a file is binary/ascii in Java
pdf getting corrupted while transfering through FTP
Reading image and convert it to Base64 format
converting from binary to ascii
Binary to Ascii converter in Java?