Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isn't it all just

  StreamUtils.copy(System.in, System.out)
I'm pretty sure there is a function that just copies an input stream to an output stream in commons-lang.

Still I agree with him - I won't write Java in a test like that. It is almost impossible to write Java fast without an IDE to autocomplete everything for you. There are way too many names to remember. I can't even tell you what package StreamUtils are in or if it's StreamUtils or FileUtils.



It is pretty much just that... although I think StreamUtils doesn't flush so you'd need to add that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: