A StreamWriter will close the underlying stream when Dispose is called so if you try the following pattern you’ll receive a “Cannot access a closed Stream” error message. Using MS As New MemoryStream() Using SW As New StreamWriter(MS, System.Text.Encoding.UTF8) SW.Write(“Hello”) End Using Using SR As New StreamReader(MS, System.Text.Encoding.UTF8) Return SR.ReadToEnd()…