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

Definición

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

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

Parámetros

array
Byte[]

Búfer en el que se leen los datos.The buffer to read data into.

offset
Int32 Int32 Int32 Int32

Desplazamiento de bytes en la array donde va a comenzar la lectura.The byte offset in array at which to begin reading.

numBytes
Int32 Int32 Int32 Int32

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

callback
AsyncCallback AsyncCallback AsyncCallback AsyncCallback

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

state
Object Object Object Object

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

Devoluciones

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

Excepciones

La longitud de la matriz menos offset es menor que numBytes.The array length minus offset is less than numBytes.

Se intentó efectuar una lectura asincrónica más allá del final del archivo.An asynchronous read was attempted past the end of the file.

Se aplica a