code: func (r *GoResponse) WriteStream(name string, contentlen int64, modtime time.Time, reader io.Reader) error {
  	// Check to see if the output stream is modified, if not send it using the
  	// Native writer
  	written := false
  	if _, ok := r.Writer.(http.ResponseWriter); ok {
  		if rs, ok := reader.(io.ReadSeeker); ok {
  			http.ServeContent(r.Original, r.Request.Original, name, modtime, rs)
  			written = true
  		}
  	}
  	if !written {
  		// Else, do a simple io.Copy.
  		ius := r.Request.Original.Header.Get("If-Unmodified-Since")
  		if t, err := http.ParseTime(ius); err == nil && !modtime.IsZero() {
  			// The Date-Modified header truncates sub-second precision, so
  			// use mtime < t+1s instead of mtime <= t to check for unmodified.
  			if modtime.Before(t.Add(1 * time.Second)) {
  				h := r.Original.Header()
  				delete(h, "Content-Type")
  				delete(h, "Content-Length")
  				if h.Get("Etag") != "" {
  					delete(h, "Last-Modified")
  				}
  				r.Original.WriteHeader(http.StatusNotModified)
  				return nil
  			}
  		}
  
  		if contentlen != -1 {
  			header := ServerHeader(r.Goheader)
  			if writer, found := r.Writer.(*CompressResponseWriter); found {
  				header = ServerHeader(writer.Header)
  			}
  			header.Set("Content-Length", strconv.FormatInt(contentlen, 10))
  		}
  		if _, err := io.Copy(r.Writer, reader); err != nil {
  			r.Original.WriteHeader(http.StatusInternalServerError)
  			return err
  		} else {
  			r.Original.WriteHeader(http.StatusOK)
  		}
  	}
  	return nil
  }
docs: // Write output to stream