for text file you should use FileReader and for binary , you could use
FileInputStream...
code is like :
try {
reader = new BufferedReader(new FileReader(fileName));
} catch (FileNotFoundException e) {e.printStackTrace();}
then you could read it line by line using method BufferedReader.readLine() ;