StreamExtensions.cs 365 B

12345678910111213141516
  1. using System.IO;
  2. namespace Abp.IO.Extensions
  3. {
  4. public static class StreamExtensions
  5. {
  6. public static byte[] GetAllBytes(this Stream stream)
  7. {
  8. using (var memoryStream = new MemoryStream())
  9. {
  10. stream.CopyTo(memoryStream);
  11. return memoryStream.ToArray();
  12. }
  13. }
  14. }
  15. }