// WriteHeader sends an HTTP response header
503982
func (rrw *RecordingResponseWriter) WriteHeader(code int) {
	rrw.Code = code
	rrw.w.WriteHeader(code)
}
800562
func writeTo31Header(w io.Writer, id uint8, data []byte) error {
	if len(data) > 0 {
		if err := binary.Write(w, binary.LittleEndian, id); err != nil {
			return err
		}
		if err := binary.Write(w, binary.LittleEndian, uint16(len(data))); err != nil {
			return err
		}
		if err := binary.Write(w, binary.LittleEndian, data); err != nil {
			return err
		}
	}
	return nil
}
1124140
func (m *MailYak) writeHeaders(buf io.Writer) error {

	if _, err := buf.Write([]byte(m.fromHeader())); err != nil {
		return err
	}

	if _, err := buf.Write([]byte("Mime-Version: 1.0\r\n")); err != nil {
		return err
	}

	fmt.Fprintf(buf, "Date: %s\r\n", m.date)

	if m.replyTo != "" {
		fmt.Fprintf(buf, "Reply-To: %s\r\n", m.replyTo)
	}

	fmt.Fprintf(buf, "Subject: %s\r\n", m.subject)

	for _, to := range m.toAddrs {
		fmt.Fprintf(buf, "To: %s\r\n", to)
	}

	for _, cc := range m.ccAddrs {
		fmt.Fprintf(buf, "CC: %s\r\n", cc)
	}

	if m.writeBccHeader {
		for _, bcc := range m.bccAddrs {
			fmt.Fprintf(buf, "BCC: %s\r\n", bcc)
		}
	}

	for k, v := range m.headers {
		fmt.Fprintf(buf, "%s: %s\r\n", k, v)
	}

	return nil
}
190763
func (b *BaseQueryBuilder) WriteHead(buffer *bytes.Buffer) {
	buffer.WriteString(b.head)
}
189549
func (rw *responseWriter) WriteHeader(c int) {
	if rw.Written() {
		return
	}
	rw.status = c
	rw.w.WriteHeader(c)
}
1033876
func (r *ResponseFilterWriter) WriteHeader(code int) {
	// Determine if compression should be used or not.
	r.shouldCompress = true
	for _, filter := range r.filters {
		if !filter.ShouldCompress(r) {
			r.shouldCompress = false
			break
		}
	}

	if r.shouldCompress {
		// replace discard writer with ResponseWriter
		if gzWriter, ok := r.gzipResponseWriter.Writer().(*gzip.Writer); ok {
			gzWriter.Reset(r.ResponseWriter)
		}
		// use gzip WriteHeader to include and delete
		// necessary headers
		r.gzipResponseWriter.WriteHeader(code)
	} else {
		r.ResponseWriter.WriteHeader(code)
	}
	r.statusCodeWritten = true
}
1211298
func (r *recordResponseWriter) WriteHeader(i int) {
	r.statusCode = i
	if !r.headersLogged {
		writeHeaders(&r.headers, i, r.ResponseWriter.Header())
		r.headersLogged = true
	}
	r.ResponseWriter.WriteHeader(i)
}
91385
func (resp *Response) WriteHeader(defaultStatusCode int, defaultContentType string) {
	if resp.ContentType == "" {
		resp.ContentType = defaultContentType
	}
	resp.Out.internalHeader.Set("Content-Type", resp.ContentType)
	if resp.Status == 0 {
		resp.Status = defaultStatusCode
	}
	resp.SetStatus(resp.Status)
}
618244
func (writer *Writer) WriteHeader() error {
	if !writer.Resource.Config.WithoutHeader {
		writer.currentRow++
		for key, meta := range writer.metas {
			writer.Writer.SetCellValue(writer.sheetName, toAxis(key, writer.currentRow), meta.Header)
		}
	}
	return nil
}
38604
func writeHeaders(w io.Writer, statusCode int, headers http.Header) {
	fmt.Fprintf(w, "%d %s\n", statusCode, http.StatusText(statusCode))
	for k, v := range headers {
		fmt.Fprintf(w, "%s: %s\n", k, v[0])
	}
}
666203
func (rb *ResponseBuffer) CopyHeader() {
	for field, val := range rb.header {
		rb.ResponseWriterWrapper.Header()[field] = val
	}
}
572840
func (c *CompressResponseWriter) WriteHeader(status int) {
	if c.closed {
		return
	}
	c.headersWritten = true
	c.prepareHeaders()
	c.Header.SetStatus(status)
}
833149
func (h Head) Write(w http.ResponseWriter) {
	w.Header().Set(ContentType, h.ContentType)
	w.WriteHeader(h.Status)
}
1203333
func (w internalResponseWriter) WriteHeader(code int) {
	if !isInternalRedirect(w) {
		w.ResponseWriterWrapper.WriteHeader(code)
	}
}
927213
func (r *ResponseRecorder) WriteHeader(status int) {
	r.status = status
	r.ResponseWriter.WriteHeader(status)
}
966933
func (a ChmodAdapter) WriteHeader(hdr *tar.Header) error {
	if hdr.FileInfo().Mode()&os.ModeSymlink == 0 {
		newMode := hdr.Mode &^ 0777
		if hdr.FileInfo().IsDir() {
			newMode |= a.NewDirMode
		} else if hdr.FileInfo().Mode()&0010 != 0 { // S_IXUSR
			newMode |= a.NewExecFileMode
		} else {
			newMode |= a.NewFileMode
		}
		hdr.Mode = newMode
	}
	return a.Writer.WriteHeader(hdr)
}
1183597
func (c *Call) WriteResponseHeader(k, v string) error {
	if c == nil {
		return yarpcerrors.InvalidArgumentErrorf(
			"failed to write response header: " +
				"Call was nil, make sure CallFromContext was called with a request context")
	}
	if c.ic.disableResponseHeaders {
		return yarpcerrors.InvalidArgumentErrorf("call does not support setting response headers")
	}
	c.ic.resHeaders = append(c.ic.resHeaders, keyValuePair{k: k, v: v})
	return nil
}