A quick look at the ASCII character set shows it only uses the first 127 byte values. You could read with a stream and see if you find any bytes with value over 127. That would make them negative in Java, wouldn't it.
Uh oh, the "extended ascii" set uses all 255 values. With that, you're out of luck.
Can you define "binary" and "ASCII" any better ... what kinds of files are you likely to run into?
http://www.lookuptables.com/ [ May 04, 2005: Message edited by: Stan James ]