3 ms·
It's not hard to write a utility that wraps an InputStream in an Iterator so you can do things like: for(String line : readLines(System.in)) { //do somet
by ZitchDog 17y ago
It's not hard to write a utility that wraps an InputStream in an Iterator so you can do things like:
for(String line : readLines(System.in)) {
//do something with line here
}
- fizx 17y agoLike org.apache.commons.io.IOUtils.lineIterator? Ultimately, I choose to either be a Maven project and require half the world, or just a single file that's easily compiled. If it's the latter, I don't bother creating many abstractions.