Tuesday, 18 April 2017

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



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


Answer




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



Stream stream = new MemoryStream(byteArray);

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...