static Stream CopyStream(Stream streamInput) { Stream streamOutput = new TestMemoryStream(); streamInput.CopyTo(streamOutput); streamInput.Position = 0; streamOutput.Position = 0; return(streamOutput); }
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); }