I have a BufferedReader that's reading a file. The file can easily have an empty line between 2 paragraphs ex:
Lorem ipsum dolor sit amet, mel in docendi eleifend sapientem, mei cu natum possit salutandi. Quaeque legimus appareat cum in, tamquam cotidieque duo in. Justo ubique efficiantur ei sit, idque dicat sadipscing ad sit. Amet consul disputationi ei sea. At reque lorem quo, animal singulis per cu, usu euripidis reprimique inciderint eu.
Ocurreret dissentias ei per. Copiosae vulputate vel ei, ne est dissentias adversarium, ad quo graecis nostrum volutpat. Vix ut sale persequeris, id est volumus noluisse, mel et ridens molestiae. Ut qui iriure volutpat contentiones, unum propriae inciderint ut duo. Ei singulis delicata per. Usu verterem nominati in.
The BufferedReader stops reading when it reaches the end of the first paragraph. I know why it stops as it thinks as long as an empty line is found, it thinks it's the end of the file, which is my problem.
I've been using the while loop way to iterate through the file.
I've scrambled around this problem so much I scrapped my original bufferedreader method and editted it a lot of times, but it was something like: (pseudo code, this code is not correct. notice the while loop mainly)
public static String currenttxt() throws IOException {
BufferedReader br = new BufferedReader(new FileReader(file));
try {
while (br.readLine() != null) {
return br.readline();
}
} catch (Exception e) {
e.PrintStackTrace();
}
}
How can I solve this issue?