First, get an OutputStream from Writer . See this question
Then pass it as an argument to the PrintStream constructor:
OutputStream os = new WriterOutputStream(writer); PrintStream ps = new PrintStream(os);
Update: commons-io 2.0 WriterOutputStream , so use it.
Bozho
source share