解决方法
首先从Writer获取OutputStream.见
this question
然后将它作为参数传递给PrintStream构造函数:
OutputStream os = new WriterOutputStream(writer); PrintStream ps = new PrintStream(os);
更新:commons-io 2.0有WriterOutputStream
,所以使用它.