Convert problem
how can I convert byte[] to MemoryStream in c#
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted May 12, 2013, 1:43 AM EDT
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/3206aa81-f83b-41c8-aded-6149ad88334d
Jignesh TrivediRank #16 · 50.3K reputationPosted May 12, 2013, 8:25 PM EDT
hi,
you can try following code
byte[] myByte = new byte[20];
//fill up you byte array..
MemoryStream stream = new MemoryStream();
stream.Write(myByteArray, 0, myByte.Length);
Alternatively way
byte[] myBytes = new byte[20];
//fill up you byte array..
MemoryStream stream = new MemoryStream(myBytes);
hope this will help you.