code: 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);
      }
docs: Create a new PrintWriter for this OutputStream.  The writer is passed to the
  closure, and will be closed before this method returns.
  
  @param stream  an OutputStream
  @param closure the closure to invoke with the PrintWriter
  @return the value returned by the closure
  @throws IOException if an IOException occurs.
  @since 2.2.0