Here you can find the source of getInputStream(String string)
Parameter | Description |
---|---|
string | the String. |
public static InputStream getInputStream(String string)
//package com.java2s; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException; public class Main { public static final String ENCODING_UTF8 = "UTF-8"; /**//from w w w . j a v a 2 s . c om * Get an InputStream for the String. * * @param string the String. * @return the InputStream. */ public static InputStream getInputStream(String string) { try { return new BufferedInputStream(new ByteArrayInputStream(string.getBytes(ENCODING_UTF8))); } catch (UnsupportedEncodingException ex) { throw new RuntimeException(ex); } } }