diff --git a/sdk/src/Core/Amazon.Util/AWSSDKUtils.cs b/sdk/src/Core/Amazon.Util/AWSSDKUtils.cs index 0c2266b933bb..940160580474 100644 --- a/sdk/src/Core/Amazon.Util/AWSSDKUtils.cs +++ b/sdk/src/Core/Amazon.Util/AWSSDKUtils.cs @@ -915,19 +915,7 @@ public static void CopyStream(Stream source, Stream destination) /// public static void CopyStream(Stream source, Stream destination, int bufferSize) { - if (source == null) - throw new ArgumentNullException("source"); - if (destination == null) - throw new ArgumentNullException("destination"); - if (bufferSize <= 0) - throw new ArgumentOutOfRangeException("bufferSize"); - - byte[] array = new byte[bufferSize]; - int count; - while ((count = source.Read(array, 0, array.Length)) != 0) - { - destination.Write(array, 0, count); - } + source.CopyTo(destination, bufferSize); } #endregion