FileStream.BeginRead(Byte[], Int32, Int32, AsyncCallback, Object) Méthode

Définition

Commence une opération de lecture asynchrone. Utilisez ReadAsync(Byte[], Int32, Int32, CancellationToken) à la place.

public:
 override IAsyncResult ^ BeginRead(cli::array <System::Byte> ^ array, int offset, int numBytes, AsyncCallback ^ userCallback, System::Object ^ stateObject);
public:
 override IAsyncResult ^ BeginRead(cli::array <System::Byte> ^ array, int offset, int numBytes, AsyncCallback ^ callback, System::Object ^ state);
public override IAsyncResult BeginRead(byte[] array, int offset, int numBytes, AsyncCallback userCallback, object stateObject);
public override IAsyncResult BeginRead(byte[] array, int offset, int numBytes, AsyncCallback callback, object state);
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, userCallback As AsyncCallback, stateObject As Object) As IAsyncResult
Public Overrides Function BeginRead (array As Byte(), offset As Integer, numBytes As Integer, callback As AsyncCallback, state As Object) As IAsyncResult

Paramètres

arraybuffer
Byte[]

Mémoire tampon dans laquelle lire les données.

offset
Int32

Décalage d’octet dans array lequel commencer la lecture.

numBytescount
Int32

Nombre maximal d’octets à lire.

callbackuserCallback
AsyncCallback

Méthode à appeler lorsque l’opération de lecture asynchrone est terminée.

statestateObject
Object

Objet fourni par l’utilisateur qui distingue cette demande de lecture asynchrone particulière d’autres requêtes.

Retours

Objet qui référence la lecture asynchrone.

Exceptions

La longueur du tableau moins offset est inférieure à numBytes.

array a la valeur null.

offset ou numBytes est négatif.

Une lecture asynchrone a été tentée au-delà de la fin du fichier.

S’applique à