Fix #1272: Reimplement completely java.io.PrintStream.