Compartir a través de


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

Definición

Comienza una operación de escritura asincrónica. Considere usar WriteAsync(Byte[], Int32, Int32, CancellationToken) en su lugar.

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

Parámetros

arraybuffer
Byte[]

Búfer que contiene los datos que se van a escribir en la secuencia actual.

offset
Int32

Desplazamiento en bytes de base cero en array desde donde se comienzan a copiar los bytes en la secuencia actual.

numBytescount
Int32

Número máximo de bytes que se pueden escribir.

callbackuserCallback
AsyncCallback

Método al que se va a llamar cuando se complete la operación de escritura asincrónica.

statestateObject
Object

Objeto proporcionado por el usuario que distingue esta solicitud de escritura asincrónica de otras.

Devoluciones

Objeto que hace referencia a la escritura asincrónica.

Excepciones

La longitud de array menos offset es menor que numBytes.

array es null.

offset o numBytes es negativo.

La secuencia no admite escritura.

La secuencia está cerrada.

Error de E/S.

Se aplica a