Uređivanje

Dijeli putem


Stream.ReadExactly Method

Definition

Overloads

ReadExactly(Span<Byte>)

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

ReadExactly(Byte[], Int32, Int32)

Reads count number of bytes from the current stream and advances the position within the stream.

ReadExactly(Span<Byte>)

Source:
Stream.cs
Source:
Stream.cs
Source:
Stream.cs

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

public:
 void ReadExactly(Span<System::Byte> buffer);
public void ReadExactly (Span<byte> buffer);
member this.ReadExactly : Span<byte> -> unit
Public 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 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

ReadExactly(Byte[], Int32, Int32)

Source:
Stream.cs
Source:
Stream.cs
Source:
Stream.cs

Reads count number of bytes from the current stream and advances the position within the stream.

public:
 void ReadExactly(cli::array <System::Byte> ^ buffer, int offset, int count);
public void ReadExactly (byte[] buffer, int offset, int count);
member this.ReadExactly : byte[] * int * int -> unit
Public Sub ReadExactly (buffer As Byte(), offset As Integer, count As Integer)

Parameters

buffer
Byte[]

An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current stream.

offset
Int32

The byte offset in buffer at which to begin storing the data read from the current stream.

count
Int32

The number of bytes to be read from the current stream.

Exceptions

buffer is null.

offset is outside the bounds of buffer.

-or-

count is negative.

-or-

The range specified by the combination of offset and count exceeds the length of buffer.

The end of the stream is reached before reading count number of bytes.

Remarks

When count is 0 (zero), this read operation will be completed without waiting for available data in the stream.

Applies to