aspose file tools*
The moose likes Beginning Java and the fly likes difference between ASCII and binary files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "difference between ASCII and binary files" Watch "difference between ASCII and binary files" New topic
Author

difference between ASCII and binary files

Gica Butoiu
Greenhorn

Joined: Apr 19, 2001
Posts: 3
How can I tell in Java if a file is ASCII (it contains only ASCII characters) or binary ? I mean is there another method without checking the entire content of the file ?
--gica
Fred Hosch
Author
Greenhorn

Joined: Apr 16, 2001
Posts: 23
well, in the unix world there's a magic number at the start of
the file that you can check. (man magic). god only knows
what things look like in the devil's workshop.
------------------
Fred Hosch
Author of:
An Introduction to Software Construction with Java


Fred Hosch<br />Author of:<br /><a href="http://www.amazon.com/exec/obidos/ASIN/0471354899/ref=ase_electricporkchop/107-7882751-0234939" target="_blank" rel="nofollow">An Introduction to Software Construction with Java</a>
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
As far as I know there is no way to determine the encoding method used for a particular file.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference between ASCII and binary files