Migrate from PrintStream to PrintWriter