Here you can find the source of StringTOInputStream(String str)
Parameter | Description |
---|---|
str | a parameter |
Parameter | Description |
---|---|
Exception | an exception |
public static InputStream StringTOInputStream(String str) throws Exception
//package com.java2s; import java.io.ByteArrayInputStream; import java.io.InputStream; public class Main { /**/*from w w w . java2 s .co m*/ * String to InputStream * * @param str * @return * @throws Exception */ public static InputStream StringTOInputStream(String str) throws Exception { ByteArrayInputStream is = new ByteArrayInputStream( str.getBytes("ISO-8859-1")); return is; } }