 <p>You can use <code>CopyTo</code> method of the <em>stream</em>.</p> <pre><code>MemoryStream m = new MemoryStream(); dataStream.CopyTo(m); byte[] byteArray = m.ToArray(); </code></pre> <p>You can also write directly to file</p> <pre><code>var fs = File.Create("...."); dataStream.CopyTo(fs); </code></pre>