title: How to find out which line separator BufferedReader#readLine() used to split the line?
body: <p>I am reading a file via the BufferedReader </p>
  
  <pre><code>String filename = ...
  br = new BufferedReader( new FileInputStream(filename));
  while (true) {
     String s = br.readLine();
     if (s == null) break;
     ...
  }
  </code></pre>
  
  <p>I need to know if the lines are separated by '\n' or '\r\n'
  is there way I can find out ? </p>
  
  <p>I don't want to open the FileInputStream so to scan it initially.
  Ideally I would like to ask the BufferedReader since it must know. </p>
  
  <p>I am happy to override the BufferedReader to hack it but I really don't want to open the filestream twice.</p>
  
  <p>Thanks,</p>
  
  <p><em>Note: the current line separator (returned by System.getProperty("line.separator") ) can not be used as the file could have been written by another app on another operating system.</em></p>