/// <summary> /// Create a file with random data and transfer a file to R /// </summary> /// <param name="fileName">The name of the file</param> /// <param name="connection">The RConnection</param> /// <param name="length">The length of the file to be transferred.</param> private static byte[] CreateAndTransferFile( RConnection connection , string fileName , int length ) { var data = new byte[ length ]; var rnd = new Random( 2302 ); rnd.NextBytes( data ); using ( var os = new System.IO.MemoryStream( data ) ) { connection.WriteFile( fileName , os ); } return data; }
/// <summary> /// Create a file with random data and transfer a file to R /// </summary> /// <param name="fileName">The name of the file</param> /// <param name="connection">The RConnection</param> /// <param name="length">The length of the file to be transferred.</param> private static byte[] CreateAndTransferFile(RConnection connection, string fileName, int length) { var data = new byte[length]; var rnd = new Random(2302); rnd.NextBytes(data); using (var os = new System.IO.MemoryStream(data)) { connection.WriteFile(fileName, os); } return(data); }