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.

9
  • 18
    Nothing in I/O is ever trivial. Even if it seems so at first. Commented Nov 2, 2011 at 21:17
  • This doesn't really answer the question of how to write to all of them simultaneous. Commented Feb 24, 2013 at 5:28
  • 1
    @Kevin No thanks. A for-each loop does not solve the problem of how to write them simultaneously. A for-each will write to the streams in sequence, they won't be written in parallel (i.e. simultaneously). Commented Feb 24, 2013 at 17:13
  • @ZettaSuro So spawn them in threads, but that would not be any faster if the files are on the same physical disk, and potentially slower, and I'm quite sure that's not what the OP meant. It does write all the streams in one method call, which is the problem at hand.
    – Kevin
    Commented Feb 24, 2013 at 17:32
  • 1
    @ZettaSuro A single method call instead of a loop every time. Set up the stream once to write to all the streams you want, then just teeos.write(stuff).
    – Kevin
    Commented Feb 24, 2013 at 17:47