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

Definitie

Begint een asynchrone leesbewerking. Overweeg in plaats daarvan ReadAsync(Byte[], Int32, Int32, CancellationToken) te gebruiken.

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

Parameters

arraybuffer
Byte[]

De buffer om gegevens in te lezen.

offset
Int32

De byte-offset array waarin moet worden gelezen.

numBytescount
Int32

Het maximum aantal bytes dat moet worden gelezen.

callbackuserCallback
AsyncCallback

De methode die moet worden aangeroepen wanneer de asynchrone leesbewerking is voltooid.

statestateObject
Object

Een door de gebruiker verstrekt object dat deze specifieke asynchrone leesaanvraag onderscheidt van andere aanvragen.

Retouren

Een object dat verwijst naar de asynchrone leesbewerking.

Uitzonderingen

De matrixlengte min offset is kleiner dan numBytes.

array is null.

offset of numBytes is negatief.

Er is geprobeerd een asynchrone leesbewerking uit te proberen voorbij het einde van het bestand.

Van toepassing op