Android examples for java.io:InputStream
Convert string to InputStream
import android.content.Context; import android.text.TextUtils; import android.util.Log; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Locale; public class Main{ public static InputStream string2InputStream(String str) { ByteArrayInputStream stream = new ByteArrayInputStream( str.getBytes());/*from ww w . ja v a 2 s. c om*/ return stream; } }