public static InputStream toStream ( String content , Charset charset ) { byte [ ] bytes = content . getBytes ( charset ) ; return new ByteArrayInputStream ( bytes ) ; }
Converts the string of given content to an input stream .