Using BufferedReader to read Text File

I’m having problems with using the BufferedReader I want to print the 6 lines of a text file: public class Reader { public static void main(String[]args) throws IOException{ FileReader in = …

Determining binary/text file type in Java?

Namely, how would you tell an archive (jar/rar/etc.) file from a textual (xml/txt, encoding-independent) one?