Here you can find the source of getInputStreamFromString(String _string)
Parameter | Description |
---|---|
_string | The resource string |
Parameter | Description |
---|---|
IOException | an exception |
public static InputStream getInputStreamFromString(String _string) throws IOException
//package com.java2s; //License from project: Mozilla Public License import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.IOException; public class Main { /**/*from ww w.j ava 2 s . c o m*/ * Get an input stream from a source String. * @param _string The resource string * @return an {@link InputStream} representing the resource * @throws IOException */ // Get an InputStream from a String. public static InputStream getInputStreamFromString(String _string) throws IOException { return (new ByteArrayInputStream(_string.getBytes("UTF-8"))); } }