title: Convert a String to Stream
body: <p>I've download an image from the Internet and converted to a String (This is not changeable)</p>
  
  <pre><code>Dim Request As System.Net.WebRequest = _
    System.Net.WebRequest.Create( _
    "http://www.google.com/images/nav_logo.png")
  
  Dim WebResponse As System.Net.HttpWebResponse = _
    DirectCast(Request.GetResponse(), System.Net.HttpWebResponse)
  
  Dim Stream As New System.IO.StreamReader( _
    WebResponse.GetResponseStream, System.Text.Encoding.UTF8)
  
  Dim Text as String = Stream.ReadToEnd
  </code></pre>
  
  <p>How can I convert the String back to the Stream?</p>
  
  <p>So I can use that stream to get the image.</p>
  
  <p>Like this:</p>
  
  <pre><code>Dim Image As New Drawing.Bitmap(WebResponse.GetResponseStream)
  </code></pre>
  
  <p>But now I've only the Text String, so I need something like this:</p>
  
  <pre><code>Dim Stream as Stream = ReadToStream(Text, System.Text.Encoding.UTF8)
  Dim Image As New Drawing.Bitmap(Stream)
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>This engine was primarily used for downloading web pages but I'm trying to use it for downloading images too.
  The format of the string is UTF8, as given in the example code...</p>
  
  <p>I've tried to use the <code>MemoryStream(Encoding.UTF8.GetBytes(Text))</code>, but I got this error when loading the stream to the image:</p>
  
  <blockquote>
    <p>A generic error occurred in GDI+.</p>
  </blockquote>
  
  <p>What gets lost in the conversions?</p>