title: What is simplest way to read a file into String?
body: <p>I am trying to read a simple text file into a String. Of course there is the usual way of getting the input stream and iterating with readLine() and reading contents into String. </p>
  
  <p>Having done this hundreds of times in past, I just wondered how can I do this in minimum lines of code? Isn't there something in java like <code>String fileContents = XXX.readFile(myFile/*File*/)</code> .. rather anything that looks as simple as this?</p>
  
  <p>I know there are libraries like Apache Commons IO which provide such simplifications or even I can write a simple Util class to do this. But all that I wonder is - this is a so frequent operation that everyone needs then why doesn't Java provide such simple function? Isn't there really a single method somewhere to read a file into string with some default or specified encoding?</p>