Bagikan melalui


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

Definisi

Memulai operasi tulis asinkron. Pertimbangkan untuk menggunakan WriteAsync(Byte[], Int32, Int32, CancellationToken) sebagai gantinya.

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

Parameter

arraybuffer
Byte[]

Buffer yang berisi data untuk ditulis ke aliran saat ini.

offset
Int32

Offset byte berbasis nol untuk array mulai menyalin byte ke aliran saat ini.

numBytescount
Int32

Jumlah maksimum byte yang akan ditulis.

callbackuserCallback
AsyncCallback

Metode yang akan dipanggil ketika operasi penulisan asinkron selesai.

statestateObject
Object

Objek yang disediakan pengguna yang membedakan permintaan tulis asinkron khusus ini dari permintaan lain.

Mengembalikan

Objek yang mereferensikan penulisan asinkron.

Pengecualian

array panjang minus offset kurang dari numBytes.

arrayadalah null.

offset atau numBytes negatif.

Aliran tidak mendukung penulisan.

Aliran ditutup.

Terjadi kesalahan I/O.

Berlaku untuk