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

Definice

Spustí asynchronní operaci čtení. Zvažte místo toho použití ReadAsync(Byte[], Int32, Int32, CancellationToken) .

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

Parametry

arraybuffer
Byte[]

Vyrovnávací paměť pro čtení dat.

offset
Int32

Posun bajtu, od array kterého se má začít číst.

numBytescount
Int32

Maximální počet bajtů ke čtení.

callbackuserCallback
AsyncCallback

Metoda, která se má volat při dokončení asynchronní operace čtení.

statestateObject
Object

Objekt zadaný uživatelem, který odlišuje tento konkrétní asynchronní požadavek na čtení od jiných požadavků.

Návraty

Objekt, který odkazuje na asynchronní čtení.

Výjimky

Délka pole minus offset je menší než numBytes.

array je null.

offset nebo numBytes je negativní.

Za koncem souboru došlo k pokusu o asynchronní čtení.

Platí pro