如何将Reader转换为InputStream,将Writer转换为OutputStream? [英] How to convert a Reader to InputStream and a Writer to OutputStream?

查看:1022
本文介绍了如何将Reader转换为InputStream,将Writer转换为OutputStream?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法可以避免处理文本编码问题?

Is there an easy way to avoid dealing with text encoding problems?

推荐答案

你无法真正避免处理文本编码问题,但有现有的解决方案:

You can't really avoid dealing with the text encoding issues, but there are existing solutions:

  • Reader to InputStream: ReaderInputStream
  • Writer to OutputStream: WriterOutputStream

您只需选择您选择的编码。

You just need to pick the encoding of your choice.

这篇关于如何将Reader转换为InputStream,将Writer转换为OutputStream?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆