Why are there no simple IO-utils in the JDK to read an entire file into a String?
In the comments to my answer about reading an entire file into memory with
, I argued that the reason there is no integer-integer file in the -String Method in Java is that it (of course) doesn't scale with respect to how large file and how much heap you have.
However, I think everyone has some method like:
String contents = IOUtil.readFile(f, "utf-8");
And the implementation of the method is just a few lines of code. Why didn't they just add this to the JDK in the first place? Is this my (scalability) reason or is there some other reason it was omitted?
source to share