News for hackers. Stuff that matters.
Re:Why I like Java by cbsmith on Tuesday March 25, 2014 @02:44PM (#7467914)
> I've never copied one stream to another by hand, byte by byte.

Yeah, but you've probably done a read and write independently. This is just about joining the two together.

> There's a method in one of the apache commons libraries for that.

Yup, and that's great to use that, and you'll no doubt end up with more efficient code most of the time if you do. But... you still should be able to write correct code for reading bytes from one stream, writing to another, without losing data in between.

Re:Why I like Java by lmm on Tuesday March 25, 2014 @03:26PM (#7468295)
> you still should be able to write correct code for reading bytes from one stream, writing to another, without losing data in between.

With access to Google and the library documentation sure, but I don't use those APIs often enough to be worth keeping in memory.

Re:Why I like Java by cbsmith on Tuesday March 25, 2014 @10:56PM (#7471265)
> With access to Google

Why the heck would you need Google

> and the library documentation

It's an online quiz.

> sure, but I don't use those APIs often enough to be worth keeping in memory.

You don't worry about it, but it tends to accumulate in one's mind anyway.

Here's the thing though. People are posting solutions on HN... and getting it wrong.