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

Definice

Zahájí asynchronní operaci čtení. Místo toho zvažte použití ReadAsync(Byte[], Int32, Int32, CancellationToken) .

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 ^ 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[] 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[] 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 (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, 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 do.

offset
Int32

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

numBytescount
Int32

Maximální počet bajtů, které se mají přečíst.

callbackuserCallback
AsyncCallback

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

statestateObject
Object

Objekt poskytovaný uživatelem, který rozliš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í.

Došlo k pokusu o asynchronní čtení za konec souboru.

Platí pro