Stream.ValidateBufferArguments(Byte[], Int32, Int32) Method

Definition

Validates arguments provided to reading and writing methods on Stream.

protected static void ValidateBufferArguments (byte[] buffer, int offset, int count);

Parameters

buffer
Byte[]

The array "buffer" argument passed to the reading or writing method.

offset
Int32

The integer "offset" argument passed to the reading or writing method.

count
Int32

The integer "count" argument passed to the reading or writing method.

Exceptions

buffer was null.

offset was outside the bounds of buffer, or count was negative, or the range specified by the combination of offset and count exceed the length of buffer.

Applies to

Product Versions
.NET 6, 7, 8, 9