File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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 ]
 
wood burning stoves
 
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?