Esempio n. 1
0
        static Stream CopyStream(Stream streamInput)
        {
            Stream streamOutput = new TestMemoryStream();

            streamInput.CopyTo(streamOutput);
            streamInput.Position  = 0;
            streamOutput.Position = 0;

            return(streamOutput);
        }
Esempio n. 2
0
        static Stream GetImage(string fileName)
        {
            TestMemoryStream memoryStream = null;

            using (var fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
            {
                memoryStream = new TestMemoryStream();
                fileStream.CopyTo(memoryStream);
                memoryStream.Position = 0;
            }

            return(memoryStream);
        }