diff --git a/Duplicati/Library/Utility/Utility.cs b/Duplicati/Library/Utility/Utility.cs
index c9100b595..7372f0c39 100644
--- a/Duplicati/Library/Utility/Utility.cs
+++ b/Duplicati/Library/Utility/Utility.cs
@@ -65,9 +65,9 @@ namespace Duplicati.Library.Utility
///
/// The stream to read from
/// The stream to write to
- public static void CopyStream(Stream source, Stream target)
+ public static long CopyStream(Stream source, Stream target)
{
- CopyStream(source, target, true);
+ return CopyStream(source, target, true);
}
///
@@ -77,7 +77,7 @@ namespace Duplicati.Library.Utility
/// The stream to write to
/// True if an attempt should be made to rewind the source stream, false otherwise
/// Temporary buffer to use (optional)
- public static void CopyStream(Stream source, Stream target, bool tryRewindSource, byte[] buf = null)
+ public static long CopyStream(Stream source, Stream target, bool tryRewindSource, byte[] buf = null)
{
if (tryRewindSource && source.CanSeek)
try { source.Position = 0; }
@@ -95,6 +95,8 @@ namespace Duplicati.Library.Utility
target.Write(buf, 0, read);
total += read;
}
+
+ return total;
}
///