Here you can find the source of getInputStream(String text)
public static InputStream getInputStream(String text) throws UnsupportedEncodingException
//package com.java2s; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException; public class Main { public static InputStream getInputStream(String text) throws UnsupportedEncodingException { InputStream inputStream = new ByteArrayInputStream(text.getBytes("utf-8")); return inputStream; }/*from www . j a v a 2 s. c o m*/ }