Given a string:
String xml = "<test/>";
How do I convert it to an InputStream
in Groovy?
Currently I use:
IOUtils.toInputStream(xml, StandardCharsets.UTF_8)
It works, but I'm looking for some shorter and dependency-free way of doing that in Groovy.
Of course I know answer for Java, but it involves ugly creation of ByteArrayInputStream
. I'm looking for GDK way of solving that.