Using a WCF service to receive a stream of data (inbound from the client) that can be very, very large, what is the most efficient way to perform two operations on the stream "at once"? I realize the question is broad. Examples of the type of operation might include
- some in-server parsing of the stream data, possibly while streaming
- an archiving of the stream to SQL Server FILESTREAM
- a conversion to a byte array for some stream-incompatible use
but the key abstract point is that both operations require some kind of read operation, and the stream is not seekable (which, as I understand it, means I have to copy the stream if the operations are performed sequentially).
EDIT: This answer seems relevant too.