wood burning stoves 2.0*
The moose likes Other Java Products and Servers and the fly likes Binary to Ascii converter in Java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Binary to Ascii converter in Java?" Watch "Binary to Ascii converter in Java?" New topic

Binary to Ascii converter in Java?

Prasanth Pillai
Ranch Hand

Joined: Oct 16, 2006
Posts: 52

Is there any option available in java to convert a binary file to ascii file? Any help is greatly appreciated.

Paul Clapham

Joined: Oct 14, 2005
Posts: 18126

Not in general. You'd have to have some rules about how the conversion was supposed to work. For example if I had a file containing six binary 00 bytes, what would you expect as the "ASCII equivalent" of that?

Once you have some rules in mind, it may be easier to find products that implement those rules.
Prasanth Pillai
Ranch Hand

Joined: Oct 16, 2006
Posts: 52
thanks for the response. I was under the assumption that its a generalized one. Because I see many tools available in the internet for this convertion. So I was wondering whether is there any such tool which can be integrated with a java code?
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24166

If you point us to a tool somewhere on the Internet which does this conversion, perhaps we could look at it and thus learn what it is you really want to do. But as Paul said, gently, there is no such thing as a generic binary-to-ASCII conversion -- the concept simply doesn't make any sense.

[Jess in Action][AskingGoodQuestions]
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
both binary files and text files contains bytes only.So if you binary file contains valid ascii bytes ,then you try to open the file using any ascii editor.
I could not get properly what you mean by converting binary to ascii?

Rahul Bhattacharjee
LinkedIn - Blog
I agree. Here's the link: http://aspose.com/file-tools
subject: Binary to Ascii converter in Java?
Similar Threads
Know ascii file or binary file beforehand
convert text/ascii file to binary file
difference between ASCII and binary files
Ascii to binary and binary to ascii
Checking if a file is binary/ascii in Java