Created
April 14, 2015 00:03
-
-
Save jchandra74/3a26e93ad85cd600d1fa to your computer and use it in GitHub Desktop.
IO Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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