title: Convert String to InputStream in Groovy
body: <p>Given a string: </p>
  
  <pre><code>String xml = "&lt;test/&gt;";
  </code></pre>
  
  <p>How do I convert it to an <code>InputStream</code> in Groovy?</p>
  
  <p>Currently I use:</p>
  
  <pre><code>IOUtils.toInputStream(xml, StandardCharsets.UTF_8)
  </code></pre>
  
  <p>It works, but I'm looking for some shorter and dependency-free way of doing that in Groovy.</p>
  
  <p>Of course I know <a href="https://stackoverflow.com/questions/782178/how-do-i-convert-a-string-to-an-inputstream-in-java">answer</a> for Java, but it involves ugly creation of <code>ByteArrayInputStream</code>. I'm looking for GDK way of solving that.</p>