FileStream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) FileStream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) FileStream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) FileStream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) Method

Definición

Comienza una operación de escritura asincrónica.Begins an asynchronous write operation. Considere usar WriteAsync(Byte[], Int32, Int32, CancellationToken) en su lugar.Consider using WriteAsync(Byte[], Int32, Int32, CancellationToken) instead.

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 userCallback, object stateObject);
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

Parámetros

array
Byte[]

Búfer que contiene los datos que se van a escribir en la secuencia actual.The buffer containing data to write to the current stream.

offset
Int32 Int32 Int32 Int32

Desplazamiento en bytes de base cero en la array en la que se comienzan a copiar los bytes en la secuencia actual.The zero-based byte offset in array at which to begin copying bytes to the current stream.

numBytes
Int32 Int32 Int32 Int32

Número máximo de bytes que se pueden escribir.The maximum number of bytes to write.

callback
AsyncCallback AsyncCallback AsyncCallback AsyncCallback

Método al que se va a llamar cuando se complete la operación de escritura asincrónica.The method to be called when the asynchronous write operation is completed.

state
Object Object Object Object

Objeto proporcionado por el usuario que distingue esta solicitud de escritura asincrónica de otras.A user-provided object that distinguishes this particular asynchronous write request from other requests.

Devoluciones

Objeto que hace referencia a la escritura asincrónica.An object that references the asynchronous write.

Excepciones

La longitud dearray menos offset es menor que numBytes.array length minus offset is less than numBytes.

La secuencia no admite escritura.The stream does not support writing.

Error de E/S.An I/O error occurred.

Se aplica a