/* * GNU AFFERO GENERAL PUBLIC LICENSE * Version 3, 19 November 2007 * Copyright (C) 2007 Free Software Foundation, Inc. * Everyone is permitted to copy and distribute verbatim copies * of this license document, but changing it is not allowed. */ using System.IO; namespace UVtools.Core.Extensions { public static class StreamExtensions { /// /// Converts stream into byte array /// /// Input /// Byte array data public static byte[] ToArray(this Stream stream) { using (var memoryStream = new MemoryStream()) { stream.CopyTo(memoryStream); return memoryStream.ToArray(); } } } }