PipeStream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) 메서드

정의

비동기 쓰기 작업을 시작합니다.

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

매개 변수

buffer
Byte[]

현재 스트림에 쓸 데이터를 포함하는 버퍼입니다.

offset
Int32

현재 스트림으로 바이트를 복사하기 시작할 buffer의 바이트 오프셋(0부터 시작)입니다.

count
Int32

쓸 최대 바이트 수입니다.

callback
AsyncCallback

비동기 쓰기 작업이 완료되면 호출할 메서드입니다.

state
Object

다른 요청에서 특정 비동기 쓰기 요청을 구별하는 사용자 제공 개체입니다.

반환

IAsyncResult

비동기 쓰기 작업을 참조하는 IAsyncResult 개체입니다.

특성

예외

buffer이(가) null인 경우

offset 가 0보다 작습니다.

또는 count 가 0보다 작습니다.

countbuffer에서 사용 가능한 바이트의 수보다 큽니다.

파이프가 닫혔습니다.

파이프에서 쓰기 작업을 지원하지 않습니다.

파이프의 연결이 끊겼거나 연결을 기다리는 중이거나 핸들이 설정되지 않았습니다.

파이프가 손상되었거나 다른 I/O 오류가 발생했습니다.

설명

EndWrite 에 대한 모든 호출에 대해 한 번 호출해야 합니다 BeginWrite. 이 작업은 호출 BeginWrite 된 동일한 코드 또는 전달된 BeginWrite콜백에서 수행할 수 있습니다.

현재 PipeStream 개체가 CanWrite 쓰기 작업을 지원하는지 여부를 확인하려면 이 속성을 사용합니다.

파이프가 닫혀 있거나 잘못된 인수가 BeginWrite전달되면 적절한 예외가 즉시 발생합니다. 비동기 쓰기 요청 중에 발생하는 오류는 요청을 수행하는 스레드 풀 스레드에서 발생합니다. 코드에서 메서드를 호출할 때 예외가 발생합니다 EndWrite .

적용 대상