Stream.ValidateCopyToArguments(Stream, Int32) Method

Definition

Validates arguments provided to the CopyTo(Stream, Int32) or CopyToAsync(Stream, Int32, CancellationToken) methods.

C#
protected static void ValidateCopyToArguments(System.IO.Stream destination, int bufferSize);

Parameters

destination
Stream

The Stream "destination" argument passed to the copy method.

bufferSize
Int32

The integer "bufferSize" argument passed to the copy method.

Exceptions

destination was null.

bufferSize was not a positive value.

destination does not support writing.

destination does not support writing or reading.

Applies to

Product Versions
.NET 6, 7, 8, 9, 10