Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions src/libraries/Common/src/System/IO/StreamHelpers.CopyValidation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,5 @@ public static void ValidateCopyToArgs(Stream source, Stream destination, int buf
throw new NotSupportedException(SR.NotSupported_UnwritableStream);
}
}

public static void ValidateCopyToArgs(Stream source, Delegate callback, int bufferSize)
{
if (callback == null)
{
throw new ArgumentNullException(nameof(callback));
}

if (bufferSize <= 0)
{
throw new ArgumentOutOfRangeException(nameof(bufferSize), bufferSize, SR.ArgumentOutOfRange_NeedPosNum);
}

if (!source.CanRead)
{
throw source.CanWrite ? (Exception)
new NotSupportedException(SR.NotSupported_UnreadableStream) :
new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
}
}
}
}
Loading