RecyclableMemoryStream.Read method (1 of 2)

October 6, 2021 · View on GitHub

Reads from the current position into the provided buffer.

public override int Read(Span<byte> buffer)
parameterdescription
bufferDestination buffer.

Return Value

The number of bytes read.

Exceptions

exceptioncondition
ObjectDisposedExceptionObject has been disposed.

See Also


RecyclableMemoryStream.Read method (2 of 2)

Reads from the current position into the provided buffer.

public override int Read(byte[] buffer, int offset, int count)
parameterdescription
bufferDestination buffer.
offsetOffset into buffer at which to start placing the read bytes.
countNumber of bytes to read.

Return Value

The number of bytes read.

Exceptions

exceptioncondition
ArgumentNullExceptionbuffer is null.
ArgumentOutOfRangeExceptionoffset or count is less than 0.
ArgumentExceptionoffset subtracted from the buffer length is less than count.
ObjectDisposedExceptionObject has been disposed.

See Also