title: How to check if next line in text file is empty?
body: <p>I want the program to find "[DesiredText]" and check if next line is empty, then if it is i want to take position of empty line. I saw few example but I doesn't work properly. All advices and clues are welcome. </p>
  
  <pre><code>BufferedReader br = new BufferedReader(new FileReader(file));
  
  String line = null;
  
  while ((line = br.readLine()) != null) {
  
   if ((line.contains("[DesiredText]") &amp;&amp; br.readLine().isEmpty())) {
  
                RandomAccessFile raf = new RandomAccessFile("D:\\Temp.txt","r");
                long position = raf.getFilePointer();
                pozycje.add(position);
                raf.close();
  
  
          }
  }
  </code></pre>