FileStream.BeginRead(Byte[], Int32, Int32, AsyncCallback, Object) Methode

Definition

Beginnt einen asynchronen Lesevorgang. Verwenden Sie stattdessen ReadAsync(Byte[], Int32, Int32, CancellationToken).

public:
 override IAsyncResult ^ BeginRead(cli::array <System::Byte> ^ array, int offset, int numBytes, AsyncCallback ^ callback, System::Object ^ state);
public:
 override IAsyncResult ^ BeginRead(cli::array <System::Byte> ^ buffer, int offset, int count, AsyncCallback ^ callback, System::Object ^ state);
public:
 override IAsyncResult ^ BeginRead(cli::array <System::Byte> ^ array, int offset, int numBytes, AsyncCallback ^ userCallback, System::Object ^ stateObject);
public override IAsyncResult BeginRead (byte[] array, int offset, int numBytes, AsyncCallback? callback, object? state);
public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback? callback, object? state);
public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback callback, object state);
public override IAsyncResult BeginRead (byte[] array, int offset, int numBytes, AsyncCallback callback, object state);
public override IAsyncResult BeginRead (byte[] array, int offset, int numBytes, AsyncCallback callback, object? state);
public override IAsyncResult BeginRead (byte[] array, int offset, int numBytes, AsyncCallback userCallback, object stateObject);
override this.BeginRead : byte[] * int * int * AsyncCallback * obj -> IAsyncResult
override this.BeginRead : byte[] * int * int * AsyncCallback * obj -> IAsyncResult
override this.BeginRead : byte[] * int * int * AsyncCallback * obj -> IAsyncResult
Public Overrides Function BeginRead (array As Byte(), offset As Integer, numBytes As Integer, callback As AsyncCallback, state As Object) As IAsyncResult
Public Overrides Function BeginRead (buffer As Byte(), offset As Integer, count As Integer, callback As AsyncCallback, state As Object) As IAsyncResult
Public Overrides Function BeginRead (array As Byte(), offset As Integer, numBytes As Integer, userCallback As AsyncCallback, stateObject As Object) As IAsyncResult

Parameter

arraybuffer
Byte[]

Der Puffer, in den Daten gelesen werden sollen.

offset
Int32

Der Byteoffset im array, ab dem gelesen werden soll.

numBytescount
Int32

Die maximale Anzahl der zu lesenden Bytes.

callbackuserCallback
AsyncCallback

Die Methode, die aufgerufen werden soll, wenn der asynchrone Lesevorgang abgeschlossen ist.

statestateObject
Object

Ein vom Benutzer bereitgestelltes Objekt, das diese asynchrone Leseanforderung von anderen Anforderungen unterscheidet.

Gibt zurück

IAsyncResult

Ein Objekt, das auf den asynchronen Lesevorgang verweist.

Ausnahmen

Die Arraylänge minus offset ist kleiner als numBytes.

array ist null.

offset oder numBytes ist ein negativer Wert.

Es wurde ein asynchroner Lesevorgang nach Erreichen des Dateiendes versucht.

Gilt für