FileStream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Commence une opération d’écriture asynchrone. Utilisez WriteAsync(Byte[], Int32, Int32, CancellationToken) à la place.
public:
override IAsyncResult ^ BeginWrite(cli::array <System::Byte> ^ array, int offset, int numBytes, AsyncCallback ^ userCallback, System::Object ^ stateObject);
public:
override IAsyncResult ^ BeginWrite(cli::array <System::Byte> ^ array, int offset, int numBytes, AsyncCallback ^ callback, System::Object ^ state);
public override IAsyncResult BeginWrite(byte[] array, int offset, int numBytes, AsyncCallback userCallback, object stateObject);
public override IAsyncResult BeginWrite(byte[] array, int offset, int numBytes, AsyncCallback callback, object state);
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, userCallback As AsyncCallback, stateObject As Object) As IAsyncResult
Public Overrides Function BeginWrite (array As Byte(), offset As Integer, numBytes As Integer, callback As AsyncCallback, state As Object) As IAsyncResult
Paramètres
- arraybuffer
- Byte[]
Mémoire tampon contenant des données à écrire dans le flux actuel.
- offset
- Int32
Décalage d’octet de base zéro dans array lequel commencer la copie d’octets dans le flux actuel.
- numBytescount
- Int32
Nombre maximal d’octets à écrire.
- callbackuserCallback
- AsyncCallback
Méthode à appeler lorsque l’opération d’écriture asynchrone est terminée.
- statestateObject
- Object
Objet fourni par l’utilisateur qui distingue cette demande d’écriture asynchrone particulière d’autres requêtes.
Retours
Objet qui référence l’écriture asynchrone.
Exceptions
array longueur moins offset est inférieure à numBytes.
array a la valeur null.
offset ou numBytes est négatif.
Le flux ne prend pas en charge l’écriture.
Le flux est fermé.
Une erreur d’E/S s’est produite.