code: func (w *commandWriter) Write(data []byte) (int, error) {
  
  	var (
  		written int
  		err     error
  	)
  
  	for len(data) > 0 {
  		if w.eof {
  			return written, io.EOF
  		}
  		// never send more data than our EnvelopeSize.
  		n := min(w.client.Parameters.EnvelopeSize-1000, len(data))
  		if err := w.sendInput(data[:n]); err != nil {
  			break
  		}
  		data = data[n:]
  		written += n
  	}
  
  	return written, err
  }
docs: // Write data to this Pipe
  // commandWriter implements io.Writer interface