docs: public static <T, U extends OutputStream> T withStream(U os, @ClosureParams(value=FirstParam.class) Closure<T> closure) throws IOException {
          try {
              T result = closure.call(os);
              os.flush();
  
              OutputStream temp = os;
              os = null;
              temp.close();
  
              return result;
          } finally {
              closeWithWarning(os);
          }
      }