如何在java中将字符串转换为输入流阅读器?
如何将值转换为 ?String
InputStreamReader
ByteArrayInputStream也做了这个把戏:
InputStream is = new ByteArrayInputStream( myString.getBytes( charset ) );
然后转换为阅读器:
InputStreamReader reader = new InputStreamReader(is);
我还找到了apache commons类,所以:IOUtils
InputStreamReader isr = new InputStreamReader(IOUtils.toInputStream(myString));