Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    One downside here is that if the file is really that long for the original question to be a highlighted concern, then this does not facilitate the programmer to implement 'message pumping' / cancellation etc from the executing thread, through a long blocking call. Commented Jun 17, 2011 at 9:32
  • @Mr. Disappointment: Very true. I was actually going to edit my answer to mention that, but got distracted. It's also possible in that situation that the OP might still want to read the entire stream, but buffer it into multiple byte[] arrays, or a composite collection of some kind. Commented Jun 17, 2011 at 9:46