The shortest solution I know:
using(var memoryStream = new MemoryStream()) { sourceStream.CopyTo(memoryStream); return memoryStream.ToArray(); }
1.4m articles
1.4m replys
5 comments
57.0k users