Here you can find the source of getInputStreamFromString(String _string)
Parameter | Description |
---|---|
_string | A String. |
public static InputStream getInputStreamFromString(String _string)
//package com.java2s; //License from project: Mozilla Public License import java.io.ByteArrayInputStream; import java.io.InputStream; public class Main { /**// w ww .j a va 2s. co m * Get an {@link InputStream} from a {@link String} instance. * @param _string A String. * @return An InputStream. */ public static InputStream getInputStreamFromString(String _string) { try { return (new ByteArrayInputStream(_string.getBytes("UTF-8"))); } catch (java.io.UnsupportedEncodingException e) { return null; } } }