title: How to make scanner strings into a Stream in Java?
body: <p>In <code>Java8</code>, how can I form a <code>Stream</code> of <code>String</code> out of the scanner read results?</p>
  
  <pre><code>InputStream is = A.class.getResourceAsStream("data.txt");
  Scanner scanner = new Scanner(new BufferedInputStream(is), "UTF-8");
  while (scanner.hasNextLine()) {
      System.out.println(scanner.nextLine());
  }
  </code></pre>
  
  <p>That is turn a scanner into a stream which I would like to iterate using <code>forEach</code>.</p>