// Write implements the io.Writer interface
545916
func (w *WinColorTerminal) Write(p []byte) (n int, err error) {
	return w.output.Write(p)
}
1292569
func (w *responseWriter) Write(p []byte) (int, error) {
	w.started = true
	return w.writer.Write(p)
}
1170457
func (aw *ansiWriter) Write(p []byte) (total int, err error) {
	if len(p) == 0 {
		return 0, nil
	}

	logger.Infof("Write: % x", p)
	logger.Infof("Write: %s", string(p))
	return aw.parser.Parse(p)
}
1200229
func (s *Writer) Write(b []byte) (int, error) {
	if s.limiter == nil {
		return s.w.Write(b)
	}

	n, err := s.w.Write(b)
	if err != nil {
		return n, err
	}

	if err := s.limiter.WaitN(s.ctx, n); err != nil {
		return n, err
	}
	return n, err
}
285699
func (w *indentWriter) Write(b []byte) (int, error) {
	w.indent()
	return w.Buffer.Write(b)
}
844964
func (n *nopWriteCloser) Write(p []byte) (int, error) {
	return n.w.Write(p)
}
496011
func (w *SyncWriter) Write(b []byte) error {
	if _, err := w.w.Write(b); err != nil {
		return err
	}
	return w.syncFn()
}
84776
func (xw *Writer) Write(buf []byte) (int, error) {
	if xw.err != nil {
		return 0, xw.err
	}

	var n, cnt int
	for len(buf) > 0 && xw.err == nil {
		// Flush chunk if necessary.
		remain := xw.nchk - xw.zw.InputOffset
		if remain <= 0 {
			xw.err = xw.Flush(FlushFull)
			continue
		}
		if remain > int64(len(buf)) {
			remain = int64(len(buf))
		}

		// Compress data for current chunk.
		offset := xw.zw.OutputOffset
		n, xw.err = xw.zw.Write(buf[:remain])
		xw.OutputOffset += xw.zw.OutputOffset - offset
		buf = buf[n:]
		cnt += n
	}

	xw.InputOffset += int64(cnt)
	return cnt, xw.err
}
142895
func (se *SimpleElement) Write(w io.Writer) error {
	return write(w, "", "", se)
}
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
}
650492
func (w *BroadcastWriter) Write(p []byte) (n int, err error) {
	for _, writer := range w.writers {
		n, err = writer.Write(p)
		if err != nil {
			return
		}
		if n != len(p) {
			err = io.ErrShortWrite
			return
		}
	}
	return len(p), nil
}
324094
func (w *stdWriter) Write(buf []byte) (n int, err error) {
	if w == nil || w.Writer == nil {
		return 0, errors.New("Writer not instantiated")
	}
	if buf == nil {
		return 0, nil
	}

	header := [stdWriterPrefixLen]byte{stdWriterFdIndex: w.prefix}
	binary.BigEndian.PutUint32(header[stdWriterSizeIndex:], uint32(len(buf)))

	line := append(header[:], buf...)

	n, err = w.Writer.Write(line)
	n -= stdWriterPrefixLen

	if n < 0 {
		n = 0
	}
	return
}
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
}
399595
func Write(w io.Writer, node Node, opts ...Option) error {
	return node.output("", w, applyOptions(opts), true, true)
}
326122
func (s *syncWriter) Write(p []byte) (n int, err error) {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.lw.Write(p)
}
223644
func (s *WriterSender) Write(p []byte) (int, error) {
	s.mu.Lock()
	defer s.mu.Unlock()
	n, err := s.writer.Write(p)
	if err != nil {
		return n, err
	}
	_ = s.writer.Flush()

	if s.buffer.Len() > 80 {
		err = s.doSend()
	}

	return n, err
}
1037697
func (w *Writer) Write(p []byte) (int, error) {
	message := string(p)

	packet := NewPacket(message, &Message{message, nil})
	packet.Level = w.Level
	packet.Logger = w.Logger
	w.Client.Capture(packet, nil)

	return len(p), nil
}