// Write writes the bytes and calls MaybeWriteHeader
324034
func (b *basicWriter) Write(buf []byte) (int, error) {
	b.maybeWriteHeader()
	return b.ResponseWriter.Write(buf)
}
1219498
func (c *Client) Write(b []byte) (int, error) {
	return c.serializer.Write(b)
}
496011
func (w *SyncWriter) Write(b []byte) error {
	if _, err := w.w.Write(b); err != nil {
		return err
	}
	return w.syncFn()
}
624109
func (w *Writer) Write(b []byte) (int, error) {
	n := len(b)
	end := len(w.buf)
	if end+n > cap(w.buf) {
		buf := make([]byte, end, 2*cap(w.buf)+n)
		copy(buf, w.buf)
		w.buf = buf
	}
	w.buf = w.buf[:end+n]
	return copy(w.buf[end:], b), nil
}
302135
func (aw *Writer) Write(b []byte) (int, error) {
	if aw.closed {
		aw.err = ErrWriteAfterClose
		return 0, aw.err
	}
	var n int
	n, aw.err = aw.w.Write(b)
	if aw.err != nil {
		return n, aw.err
	}
	aw.nb -= int64(n)
	return n, aw.err
}
280040
func (w *FuncWriter) Write(b []byte) (int, error) {
	w.fx(b)
	return len(b), nil
}
1174932
func (r *Writer) Write(b []byte) (int, error) {
	nl := ""
	if len(b) == 0 || b[len(b)-1] != '\n' {
		nl = "\n"
	}

	r.conn.SetWriteDeadline(time.Now().Add(1 * time.Second))

	_, err := fmt.Fprintf(r.conn, "  %s  %s%s", syslogHeader, b, nl)
	if err != nil {
		return 0, err
	}

	return len(b), nil
}
830670
func (p *File) Write(level logger.Level, headerLength int, data []byte) error {
	p.mu.Lock()
	defer p.mu.Unlock()

	if p.writer == nil {
		return errNilWriter
	}
	now := time.Now()
	if !isSameDay(now, p.createdTime) {
		if err := p.rotate(now); err != nil {
			return err
		}
	}
	n, err := p.writer.Write(data)
	p.written = true
	p.currentSize += n
	if p.currentSize >= p.config.MaxSize {
		p.rotate(now)
	}
	return err
}
748789
func (h *ExtendedHeader) Write(b *bytes.Buffer, ver protocol.VersionNumber) error {
	if h.IsLongHeader {
		return h.writeLongHeader(b, ver)
	}
	return h.writeShortHeader(b, ver)
}
233956
func (w *Writer) Write(p []byte) (n int, err error) {
	return w.buf.Write(p)
}
851475
func (p *ColoredConsole) Write(level logger.Level, headerLength int, data []byte) error {
	writer := p.stdout
	colorable := p.stdoutColorable
	if level <= p.config.ToStderrLevel {
		writer = p.stderr
		colorable = p.stderrColorable
	}
	var cpre []byte
	if colorable {
		cpre = p.color(level)
		if cpre != nil {
			writer.Write(cpre)
		}
	}
	_, err := writer.Write(data)
	if colorable && err == nil && cpre != nil {
		writer.Write(colorEnd)
	}
	return err
}
929335
func (w *ResponseWriter) Write(p []byte) (int, error) {
	return w.w.Write(p)
}
94489
func (o Output) Write(w io.Writer) error {
	return binary.Write(w, byteOrder, int8(o))
}
244651
func (g *Generator) writeHeader(w io.Writer) error {
	header := append([]byte("// "), []byte(g.header)...)
	header = append(header, []byte("\n\n")...)

	_, err := w.Write(header)
	return err
}
965662
func (w *BufferedWriter) Write(p []byte) (int, error) {
	if w.err != nil {
		return 0, w.err
	}

	_, w.err = w.bw.Write(p)
	if w.err != nil {
		return 0, w.err
	}

	return len(p), nil
}
363263
func (w *FakeResponseWriter) Write(data []byte) (int, error) {
	return w.buffer.Write(data)
}
844964
func (n *nopWriteCloser) Write(p []byte) (int, error) {
	return n.w.Write(p)
}