How to convert String to OutputStream?
416044Jul 12 2007 — edited Jul 12 2007A method needs a parameter OutputStream to write result data (text) to. It works fine when I set new FileOutputStream(myFile) as the parameter value. But how can I set an OutputStream that is not a file (but in memory). E.g. I would like to set a StringBuilder/StringBuffer as the parameter instead of the OutputStream. Is there a way to "wrap" a StringBuilder/StringBuffer/STring into an OutputStream?