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

정의

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

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

매개 변수

buffer
Byte[]

데이터를 읽어올 버퍼입니다.

offset
Int32

읽기를 시작할 buffer의 바이트 오프셋입니다.

count
Int32

읽을 최대 바이트 수입니다.

callback
AsyncCallback

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

state
Object

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

반환

IAsyncResult

비동기 읽기를 참조하는 IAsyncResult 개체입니다.

특성

예외

buffer이(가) null인 경우

offset 가 0보다 작습니다.

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

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

파이프가 닫혔습니다.

파이프에서 읽기 작업을 지원하지 않는 경우

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

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

설명

반환 IAsyncResult 된 개체를 메서드에 EndRead 전달하여 읽은 바이트 수를 확인하고 읽기에 사용되는 운영 체제 리소스를 해제합니다. EndRead 에 대한 모든 호출에 대해 한 번 호출해야 합니다 BeginRead. 이 작업은 호출 BeginRead 된 동일한 코드 또는 전달된 BeginRead콜백에서 수행할 수 있습니다.

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

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

적용 대상