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

Définition

Débute une opération d'écriture asynchrone.Begins an asynchronous write operation. Utilisez WriteAsync(Byte[], Int32, Int32, CancellationToken) à la place.Consider using WriteAsync(Byte[], Int32, Int32, CancellationToken) instead.

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

Paramètres

arraybuffer
Byte[]

Mémoire tampon qui contient les données à écrire dans le flux actuel.The buffer containing data to write to the current stream.

offset
Int32

Dans array, décalage d'octet de base zéro auquel commencer la copie des octets dans le flux actuel.The zero-based byte offset in array at which to begin copying bytes to the current stream.

numBytescount
Int32

Nombre maximal d'octets à écrire.The maximum number of bytes to write.

callbackuserCallback
AsyncCallback

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

statestateObject
Object

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

Retours

IAsyncResult

Objet qui référence l'écriture asynchrone.An object that references the asynchronous write.

Exceptions

La longueur dearray moins offset est inférieure à numBytes.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.

Le flux ne prend pas en charge l'écriture.The stream does not support writing.

Le flux est fermé.The stream is closed.

Une erreur d'E/S s'est produite.An I/O error occurred.

S’applique à