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

Definicja

Rozpoczyna asynchroniczne operacje zapisu.Begins an asynchronous write operation. Rozważ użycie WriteAsync(Byte[], Int32, Int32, CancellationToken) zamiast tego.Consider using WriteAsync(Byte[], Int32, Int32, CancellationToken) instead.

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[] 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

Parametry

arraybuffer
Byte[]

Bufor zawierający dane do zapisu w bieżącym strumieniu.The buffer containing data to write to the current stream.

offset
Int32

Przesunięcie bajtu (liczony od zera), w array którym rozpocznie się kopiowanie bajtów do bieżącego strumienia.The zero-based byte offset in array at which to begin copying bytes to the current stream.

numBytescount
Int32

Maksymalna liczba bajtów do zapisania.The maximum number of bytes to write.

callbackuserCallback
AsyncCallback

Metoda, która ma być wywoływana po zakończeniu asynchronicznej operacji zapisu.The method to be called when the asynchronous write operation is completed.

statestateObject
Object

Obiekt udostępniony przez użytkownika, który odróżnia to konkretne asynchroniczne żądanie zapisu z innych żądań.A user-provided object that distinguishes this particular asynchronous write request from other requests.

Zwraca

IAsyncResult

Obiekt, który odwołuje się do zapisu asynchronicznego.An object that references the asynchronous write.

Wyjątki

array Długość minus offset jest mniejsza niż numBytes .array length minus offset is less than numBytes.

array to null.array is null.

offset lub numBytes jest ujemna.offset or numBytes is negative.

Strumień nie obsługuje zapisu.The stream does not support writing.

Strumień jest zamknięty.The stream is closed.

Wystąpił błąd we/wy.An I/O error occurred.

Dotyczy