Android String to InputStream Convert String2InputStream(String str)

Here you can find the source of String2InputStream(String str)

Description

String Input Stream

Declaration

public static InputStream String2InputStream(String str) 

Method Source Code

//package com.java2s;

import java.io.ByteArrayInputStream;

import java.io.InputStream;

import java.io.UnsupportedEncodingException;

public class Main {

    public static InputStream String2InputStream(String str) {
        ByteArrayInputStream stream = null;
        try {//from   w  w  w. j  a va 2 s .  c o m
            stream = new ByteArrayInputStream(str.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return stream;
    }
}

Related

  1. StringToInputStream(String str)
  2. getInputStream(String str)
  3. StringTOInputStream(String in)
  4. StringTOInputStream(String in)