如何在Java中将字符串转换为InputStreamReader?

Yossale:

如何将String值转换为InputStreamReader

圭多:

ByteArrayInputStream也可以做到这一点:

InputStream is = new ByteArrayInputStream( myString.getBytes( charset ) );

然后转换为阅读器:

InputStreamReader reader = new InputStreamReader(is);

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章