public static < T > T withPrintWriter ( OutputStream stream , @ ClosureParams ( value = SimpleType . class , options = "java.io.PrintWriter" ) Closure < T > closure ) throws IOException { return withWriter ( newPrintWriter ( stream ) , closure ) ; }
Create a new PrintWriter for this OutputStream . The writer is passed to the closure and will be closed before this method returns .