Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
IO Extension
namespace __NAMESPACE__
{
using System.IO;
public static class StreamExtension
{
public static byte[] ToByteArray(this Stream input)
{
using (var memStream = new MemoryStream())
{
input.CopyTo(memStream);
return memStream.ToArray();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.