Here you can find the source of StringToInputStream(String str)
public static InputStream StringToInputStream(String str)
//package com.java2s; import java.io.ByteArrayInputStream; import java.io.InputStream; import android.text.TextUtils; public class Main { public static InputStream StringToInputStream(String str) { if (TextUtils.isEmpty(str)) return null; ByteArrayInputStream stream = new ByteArrayInputStream( str.getBytes());/*from w ww . j a v a 2s .c om*/ return stream; } }