private static String nextViableLine(RandomAccessFile r) throws IOException {
      String l;
      
      while ((l = r.readLine()) != null && ((l = l.trim()).length() == 0 || l.startsWith("//"))) {
         //Reading file done in loop condition!
      }
      
      return l;
   }