将String转换成InputStream

String   str   =   "";//add   your   string   content
InputStream   inputStream   =   new   ByteArrayInputStream(str.getBytes());

原文地址:https://www.cnblogs.com/liulipeng/p/3923872.html