public void Receive(Stream source, int bufferLength = 0)
 {
     using (IDataReceiver dataReceiver = CreateDataReceiver())
     {
         StreamSender.Send(source, dataReceiver, bufferLength);
     }
 }
 public void Receive(Stream source, CancellationToken cancellationToken, int bufferLength = 0)
 {
     using (IDataReceiver dataReceiver = CreateDataReceiver())
     {
         StreamSender.Send(source, dataReceiver, cancellationToken, bufferLength);
     }
 }
Example #3
0
 public static void Send(string sourceFilePath, StreamSender.IDataReceiver dataReceiver, int bufferLength = 0)
 {
     using (var source = new FileStream(sourceFilePath, FileMode.Open, FileAccess.Read, FileShare.Read))
     {
         StreamSender.Send(source, dataReceiver, bufferLength);
     }
 }