Edit

Share via


BinaryReader.ReadExactly(Span<Byte>) Method

Definition

Reads bytes from the current stream and advances the position within the stream until the buffer is filled.

public:
 virtual void ReadExactly(Span<System::Byte> buffer);
public virtual void ReadExactly(Span<byte> buffer);
abstract member ReadExactly : Span<byte> -> unit
override this.ReadExactly : Span<byte> -> unit
Public Overridable Sub ReadExactly (buffer As Span(Of Byte))

Parameters

buffer
Span<Byte>

A region of memory. When this method returns, the contents of this region are replaced by the bytes read from the current stream.

Exceptions

The stream is closed.

An I/O error occurred.

The end of the stream is reached before filling the buffer.

Remarks

When buffer is empty, this read operation will be completed without waiting for available data in the stream.

Applies to