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("ISO-8859-1")); return is; }//w w w .ja va2 s .co m }