C# Byte Array to Stream – Convert System.Byte Byte[] to System.IO.Stream Object

.netarraysc++stream

How do I convert struct System.Byte byte[] to a System.IO.Stream object in C#?

Best Answer

The easiest way to convert a byte array to a stream is using the MemoryStream class:

Stream stream = new MemoryStream(byteArray);
Related Question