Here you can find the source of getInputStream(String content)
public static final InputStream getInputStream(String content)
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException; public class Main { public static final InputStream getInputStream(String content) { try {/*from w ww . java 2s. co m*/ return new ByteArrayInputStream(content.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Problem generating input stream"); } } }