title: How to detect first and last line during reader.readLine()?
body: <p>I am reading each line of the file in the below way</p>
  
  <pre><code>BufferedReader in = new BufferedReader(new FileReader(inFile));
  
  while (null != (line = in.readLine())) {
  
  
  }
  </code></pre>
  
  <p>I want to do some validation in the first line and last line alone.  Is there any
  way to check if it's a first line and last line inside the while loop</p>
  
  <pre><code>while (null != (line = in.readLine())) {    
  
      if(firstlineoffile) {
      }
  
      else if (lastlineoffile) {
      }
  
      else
      {
      }
  
  }
  </code></pre>