In my previous question, someone has commented that write a .NET Stream to two another Streams simultaneously is possible. I only could find one way but using a temporary variable (buffer) that would store the contents (fully or partialy at once) of the input Stream.
- There is any way to do that without using buffers?
- There is any way to do it concurrently?
Using a buffer you can asynchronously write to both streams, assuming the streams support proper asynchronous access. That’s effectively concurrent – although you’ll have a tricky job keeping all the buffers in sync given that one could finish writing the first buffer a long time before the other has done so.
As far as I’m aware there’s no way to copy from one (general) stream to another without using a buffer of at least one byte. (And using just a single byte will be painfully inefficient, of course.)