title: Read first line of file with Files.lines in Java
body: <p>I want to use this code to read only the first line from a file:</p>
  
  <pre><code>String line = Files.lines(path).findFirst().get();
  </code></pre>
  
  <p>I assume that this does NOT load the contents of the entire file into memory. Instead, it opens the file, reads ONLY the first line and then closes the file. </p>
  
  <p>Is my assumption correct?</p>