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

Définition

Débute une opération de lecture asynchrone.Begins an asynchronous read operation. Utilisez ReadAsync(Byte[], Int32, Int32, CancellationToken) à la place.Consider using ReadAsync(Byte[], Int32, Int32, CancellationToken) instead.

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[] 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

Paramètres

arraybuffer
Byte[]

Mémoire tampon dans laquelle lire les données.The buffer to read data into.

offset
Int32

Dans array, décalage d'octet auquel commencer la lecture.The byte offset in array at which to begin reading.

numBytescount
Int32

Nombre maximal d'octets à lire.The maximum number of bytes to read.

callbackuserCallback
AsyncCallback

Méthode à appeler quand l'opération de lecture asynchrone est terminée.The method to be called when the asynchronous read operation is completed.

statestateObject
Object

Objet fourni par l'utilisateur qui distingue cette requête de lecture asynchrone des autres requêtes.A user-provided object that distinguishes this particular asynchronous read request from other requests.

Retours

IAsyncResult

Objet référence la lecture asynchrone.An object that references the asynchronous read.

Exceptions

La longueur du tableau moins offset est inférieure à numBytes.The array length minus offset is less than numBytes.

array a la valeur null.array is null.

offset ou numBytes est un nombre négatif.offset or numBytes is negative.

Une lecture asynchrone a été tentée au-delà de la fin du fichier.An asynchronous read was attempted past the end of the file.

S’applique à