I am using Drools Planner which takes configuration by XML. The configure method is done this way (from the javadocs):
XmlSolverConfigurer configure(InputStream in)
XmlSolverConfigurer configure(Reader reader)
XmlSolverConfigurer configure(String resource)
The configure(String resource) takes a filename, not XML contents.
I want the configure method to accept XML contents in a string object. How do I make a string compatible with Reader or InputStream for the method to accept it?
For the curious: yes, I am doing things a bit convoluted to start with.
Use a
StringReader.