wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
Similar Threads
difference between ASCII and binary files
Checking if a file is binary/ascii in Java
Ascii to binary and binary to ascii
difference between ASCII and binary files
Binary to Ascii converter in Java?