BufferedStream.EndRead(IAsyncResult) 메서드

정의

보류 중인 비동기 읽기 작업이 완료되기를 기다립니다. 대신 ReadAsync(Byte[], Int32, Int32, CancellationToken)를 사용하세요.

public:
 override int EndRead(IAsyncResult ^ asyncResult);
public override int EndRead (IAsyncResult asyncResult);
override this.EndRead : IAsyncResult -> int
Public Overrides Function EndRead (asyncResult As IAsyncResult) As Integer

매개 변수

asyncResult
IAsyncResult

대기할 보류 중인 비동기 요청에 대한 참조입니다.

반환

Int32

0과 요청한 바이트 수 사이의 스트림에서 읽은 바이트 수입니다. 스트림은 스트림의 끝에서 0만을 반환하며 그렇지 않으면 최소한 1바이트를 사용할 수 있을 때까지 차단됩니다.

예외

asyncResult이(가) null인 경우

IAsyncResult 개체는 이 클래스에 대해 BeginRead(Byte[], Int32, Int32, AsyncCallback, Object) 를 호출하여 만들어진 개체가 아닙니다.

설명

.NET Framework 4 및 이전 버전에서는 비동기 파일 작업과 EndRead 같은 BeginRead 메서드를 사용하고 구현해야 합니다. 이러한 메서드는 레거시 코드를 지원하기 위해 .NET Framework 4.5에서 계속 사용할 수 있지만, 새로운 비동기 메서드(예: ReadAsync, WriteAsyncFlushAsync)는 비동기 파일 작업을 보다 쉽게 구현하는 데 도움이 됩니다.

EndRead 읽은 바이트 수를 확인하려면 이 IAsyncResult 작업을 사용하여 호출해야 합니다.

적용 대상