I\'m trying to read a binary file but my program just stops at first line.. I think it\'s because of the strange characters the file has..I just want to extract some directions
As was said, since it is a binary file you can't use a Scanner or other character based readers. You could use a regular FileInputStream
to read the actual raw bytes of the file. Java's String
class has a constructor that will take an array of bytes and turn them into a string. You can then search that string for the file name(s). This may work if you just use the default character set.
String(byte[]): http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html FileInputStream for reading bytes: http://download.oracle.com/javase/tutorial/essential/io/bytestreams.html