// Write mocks calls to Write.
193953
func (m *MockConn) Write(b []byte) (n int, err error) {
	m.Called(b)

	// Return error if exists
	if m.WriteError != nil {
		return 0, m.WriteError
	}

	// Write into buffer
	return m.WriteBuffer.Write(b)
}
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
}
1303079
func (w *Writer) Write(p []byte) (int, error) {
	w.Lock()
	defer w.Unlock()
	return w.w.Write(p)
}
253989
func (w *syncWriter) Write(p []byte) (n int, err error) {
	w.Lock()
	n, err = w.Writer.Write(p)
	w.Unlock()
	return n, err
}
921095
func (ctx *Context) Write(s []byte) (int, error) {
	if ctx.Logger != nil {
		return ctx.Logger.Write(s)
	}
	return len(s), nil
}
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)
}
60063
func (aw *AnsiWriter) Write(b []byte) (int, error) {
	return aw.file.Write(b)
}
326122
func (s *syncWriter) Write(p []byte) (n int, err error) {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.lw.Write(p)
}
46843
func (c *Conversation) Write(b []byte) (int, error) {
	n := len(b)
	return n, c.Send(b2s(b))
}
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
}
585771
func (s *serialWriteCloser) Write(data []byte) (int, error) {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.wc.Write(data)
}
419914
func (s *Stream) Write() error {
	if s.callback.IsValid() {
		return CanNotWriteToACallbackStream
	}
	if s.out == nil {
		return CanNotWriteToAnInputOnlyStream
	}
	buf, frames, err := getBuffer(s.out, s.outParams)
	if err != nil {
		return err
	}
	return newError(C.Pa_WriteStream(s.paStream, buf, C.ulong(frames)))
}
913716
func (r *Response) Write(b []byte) (int, error) {
	return r.writer.Write(b)
}
1185030
func (rrw *RecordingResponseWriter) Write(d []byte) (int, error) {
	n, err := rrw.w.Write(d)
	rrw.BytesWritten += int64(n)
	return n, 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
}
1357933
func (m *MockVolumeDriver) Write(arg0 string, arg1 []byte, arg2 uint64, arg3 int64) (int64, error) {
	ret := m.ctrl.Call(m, "Write", arg0, arg1, arg2, arg3)
	ret0, _ := ret[0].(int64)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
221053
func (c *jsonCodec) Write(ctx context.Context, v interface{}) error {
	c.encMu.Lock()
	defer c.encMu.Unlock()

	deadline, ok := ctx.Deadline()
	if !ok {
		deadline = time.Now().Add(defaultWriteTimeout)
	}
	c.conn.SetWriteDeadline(deadline)
	return c.encode(v)
}