private void OnDownloadBytes(Guid transferId, string location, out long totalSize, long offset, int length, Stream output) { DownloadBytesEventArgs args = new DownloadBytesEventArgs(transferId, location, offset, length); if (DownloadBytes != null) { DownloadBytes(this, args); } Check.Assert <InvalidOperationException>(args.TotalSize >= 0); totalSize = args.TotalSize; args.WriteTo(output); }
private void OnDownloadBytes(Guid transferId, string location, out long totalSize, long offset, int length, Stream output) { DownloadBytesEventArgs args = new DownloadBytesEventArgs(transferId, location, offset, length); if (DownloadBytes != null) DownloadBytes(this, args); Check.Assert<InvalidOperationException>(args.TotalSize >= 0); totalSize = args.TotalSize; args.WriteTo(output); }