Here you can find the source of StringTOInputStream(String in)
public static InputStream StringTOInputStream(String in) throws Exception
//package com.java2s; import java.io.ByteArrayInputStream; import java.io.InputStream; public class Main { public static InputStream StringTOInputStream(String in) throws Exception { ByteArrayInputStream is = new ByteArrayInputStream(in.getBytes()); return is; }//from ww w . jav a2s.c o m }