I always forget how to read the contents of a file, here’s the simplest way I’ve come across.
There are other variants of Files.readAllLines
such as Files.readAllBytes
etc.
Also, if it’s a Stream
you’re after then use Files.lines
, but don’t forget to close the stream (thanks Tim Yates!).