Reading a whole file at once
suggest changeFile f = new File(path);
String content = new Scanner(f).useDelimiter("\\Z").next();
\Z is the EOF (End of File) Symbol. When set as delimiter the Scanner will read the fill until the EOF Flag is reached.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents