change the type of parameter of dump method from PrintWriter to Writer