I can't seem to find it on the net. Is there a way to just say
String s = someReader.ReadToEnd();
like the on in C#, all I have seen so far is the reading per line. Help anyone? Thanks!
Printable View
I can't seem to find it on the net. Is there a way to just say
String s = someReader.ReadToEnd();
like the on in C#, all I have seen so far is the reading per line. Help anyone? Thanks!
i dont know about a function to for reading all of it as a string but you can keep adding the new lines to the same string.
You can make your own method with a StringBuffer, I guess. But there's nothing in the API to do what you want.
But there is in the Springframework utilities or the Apache Jakarta Commons IO.
Springframework is too big to use unless you use its main facilities, but Commons IO is nice and small and a good addition.
http://jakarta.apache.org/commons/io...ase/index.html
Hey, SysError, are you making fun of penagate?Code:String data = IOUtils.toString(new FileInputStream(filename), "UTF-8");
I wasn't, but after the many personal attacks a few weeks ago, I like to think so now.Quote:
Originally Posted by CornedBee
Thanks everyone.