title: Upload data from memory to SFTP server using SSH.NET
body: <p>I am hoping to write PDF's directly to SFTP site.  The PDF's are generated from <code>ReportExecutionService.Render</code> (SSRS).  </p>
  
  <pre><code>ReportExecutionService rsExec = new ReportExecutionService();
  </code></pre>
  
  <p>I have been able to write the files locally using <code>FileStream</code>.  I am generating millions of files, so I am hoping to write them directly on SFTP using SSH.NET.  What is the syntax for taking the <code>rsExec.Render</code> result and writing to SFTP using SSH.NET?</p>
  
  <pre><code>string deviceInfo = null;
  string extension;
  string encoding;
  string mimeType;
  ConsoleApp2.ReportExecution2005.Warning[] warnings = null;
  string[] streamIDs = null;
  string format = "PDF";
  
  Byte[] results =
      rsExec.Render(
          format, deviceInfo, out extension, out mimeType, out encoding,
          out warnings, out streamIDs);
  FileStream stream = File.OpenWrite("C:\\test.pdf");
  stream.Write(results, 0, results.Length);
  stream.Close();
  </code></pre>