0

How to read a file character by character?

21st Feb 2016, 8:38 AM
Siva kumar
1 ответ
+ 3
FileInputStream fileInput = new FileInputStream("file.txt"); int r; while ((r = fileInput.read()) != -1) { char c = (char) r; // do something with the character c } fileInput.close();
19th May 2016, 12:56 PM
James Flanders