Skip to content

Commit

Permalink
Replace custom implementation of CopyStream with CopyTo (#3292)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmarbach authored Apr 22, 2024
1 parent 4c66d38 commit 815db56
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions sdk/src/Core/Amazon.Util/AWSSDKUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -904,19 +904,7 @@ public static void CopyStream(Stream source, Stream destination)
/// <param name="bufferSize"></param>
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

Expand Down

0 comments on commit 815db56

Please sign in to comment.