Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# convert stream to memorystream

 /// <summary>
        /// Convert to memory stream
        /// </summary>
        /// <param name="stream"></param>
        /// <returns></returns>
        public static byte[] ReadStream(Stream stream)
        {
            using (var ms = new MemoryStream())
            {
                stream.CopyTo(ms);
                return ms.ToArray();
            }
        }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #stream #memorystream
ADD COMMENT
Topic
Name
2+8 =