wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes Conversion of binary file to text file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Conversion of binary file to text file" Watch "Conversion of binary file to text file" New topic
Author

Conversion of binary file to text file

Smitha Vallaru
Greenhorn

Joined: Aug 15, 2006
Posts: 16
Hi,

Can anybody helpme to convert text file to binary file. I am not sure what the contents are. Probably it may be a characters and Numbers.

Any help is appreciated.


Thanks
Smitha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41110
    
  45
Welcome to JavaRanch.

Is the question how to convert a text file to a binary file, or how to convert a binary file to a text file?

Any text file is a binary file, which just happens to contain only text characters, so no conversion is necessary.

A binary file could be encoded to become a text file, e.g. using the base-64 encoding. A library like Jakarta Commons Codec can do this.

But somehow I think you're asking something different; what eaxctly are you trying to do?


Ping & DNS - my free Android networking tools app
Smitha Vallaru
Greenhorn

Joined: Aug 15, 2006
Posts: 16
I am sorry it was Binary file to text file. Thanks for pointing it out.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I'm not sure what you mean by "binary" file. Where does it come from? What does it look like if you print it on the console?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
wood burning stoves
 
subject: Conversion of binary file to text file
 
Similar Threads
Binary Files
Encoding Question
Check if a file is binary
ctrlC ctrlV a war file contents
A question regarding saving jpgs into text files.