View Single Post
  #2 (permalink)  
Old 10-08-2007, 09:21 PM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,266
hardwired is on a distinguished road
Code:
// This line reads one line in the file. while((br.readLine()) != -1) { // This line reads the next line in the file. // If this readLine call hits the end_of_file // (-1 returned) it will throw an exception. openAction.notes.append(br.readLine()+"\n"); }
Solution? Save each line that you read and isolate the
reading to the while loop condition statement, like so:
Code:
String line; while((line = br.readLine()) != -1) { openAction.notes.append(line+"\n"); }
Reply With Quote