Convert byte array to stream

L

Lasse Vågsæther Karlsen

Can anyone tell me how to convert a byte array to a stream.?
Thanks
Andrew

Create a memory stream, write the contents of the array to it.
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hello Andrew,

You can create a MemoryStream instance from that array.
 
J

Jon Skeet [C# MVP]

Lasse Vågsæther Karlsen said:
Create a memory stream, write the contents of the array to it.

It's easier than that:

Stream s = new MemoryStream(byteArray);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top