Copy MemoryStream to FileStream and save the file?

后端 未结 3 1500
抹茶落季
抹茶落季 2020-12-03 04:24

I don\'t understand what I\'m doing wrong here. I generate couple of memory streams and in debug-mode I see that they are populated. But when I try to copy MemoryStrea

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-03 04:53

    Another alternative to CopyTo is WriteTo.

    Advantage:

    No need to reset Position.

    Usage:

    outStream.WriteTo(fileStream);                
    

    Function Description:

    Writes the entire contents of this memory stream to another stream.

提交回复
热议问题