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

Définition

Débute une opération d'écriture asynchrone. (Utilisez la méthode WriteAsync(Byte[], Int32, Int32) à la place.)

public:
 override IAsyncResult ^ BeginWrite(cli::array <System::Byte> ^ array, int offset, int count, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public:
 override IAsyncResult ^ BeginWrite(cli::array <System::Byte> ^ buffer, int offset, int count, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public override IAsyncResult BeginWrite (byte[] array, int offset, int count, AsyncCallback? asyncCallback, object? asyncState);
public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback? asyncCallback, object? asyncState);
public override IAsyncResult BeginWrite (byte[] array, int offset, int count, AsyncCallback asyncCallback, object asyncState);
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, count As Integer, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult
Public Overrides Function BeginWrite (buffer As Byte(), offset As Integer, count As Integer, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

Paramètres

arraybuffer
Byte[]

Mémoire tampon qui contient les données à écrire dans le flux actuel.

offset
Int32

Décalage d’octets auquel commencer l’écriture.

count
Int32

Nombre maximal d'octets à écrire.

asyncCallback
AsyncCallback

Rappel asynchrone optionnel à appeler lorsque l'écriture est terminée.

asyncState
Object

Objet fourni par l'utilisateur qui distingue cette requête d'écriture asynchrone des autres requêtes.

Retours

Objet représentant l'écriture asynchrone qui pourrait toujours être en attente.

Exceptions

Le flux sous-jacent est null.

- ou -

Le flux sous-jacent est fermé.

Remarques

À partir de .NET Framework 4.5, vous pouvez effectuer des opérations d’écriture asynchrones à l’aide de la Stream.WriteAsync méthode . La BeginWrite méthode est toujours disponible dans les versions actuelles pour prendre en charge le code hérité. Toutefois, vous pouvez implémenter plus facilement des opérations d’E/S asynchrones à l’aide des nouvelles méthodes asynchrones. Pour plus d'informations, consultez E/S de fichier asynchrone.

La BeginWrite méthode démarre une opération d’écriture asynchrone dans un GZipStream objet de flux.

Vous devez créer une méthode de rappel qui implémente le AsyncCallback délégué et transmet son nom à la BeginWrite méthode .

S’applique à