Share this page 

Get InputStream from a StringTag(s): String/Number


    public static final String ENCODING = "UTF8"; // see note

    public static InputStream fromString(String str) {
        byte[] bytes = str.getBytes(ENCODING);
        return new ByteArrayInputStream(bytes);
    }

Note : List of supported encodings here