MemoryStream.FlushAsync(CancellationToken) 메서드
정의
이 스트림에 대한 모든 버퍼를 비동기적으로 지우고 취소 요청을 모니터링합니다.Asynchronously clears all buffers for this stream, and monitors cancellation requests.
public:
override System::Threading::Tasks::Task ^ FlushAsync(System::Threading::CancellationToken cancellationToken);
public override System.Threading.Tasks.Task FlushAsync (System.Threading.CancellationToken cancellationToken);
[System.Runtime.InteropServices.ComVisible(false)]
public override System.Threading.Tasks.Task FlushAsync (System.Threading.CancellationToken cancellationToken);
override this.FlushAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
[<System.Runtime.InteropServices.ComVisible(false)>]
override this.FlushAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overrides Function FlushAsync (cancellationToken As CancellationToken) As Task
매개 변수
- cancellationToken
- CancellationToken
취소 요청을 모니터링할 토큰입니다.The token to monitor for cancellation requests.
반환
비동기 플러시 작업을 나타내는 작업입니다.A task that represents the asynchronous flush operation.
- 특성
예외
스트림이 삭제되었습니다.The stream has been disposed.
설명
개체에 작성 된 모든 데이터 MemoryStream 는 RAM에 기록 되므로이 메서드는 중복 됩니다.Because any data written to a MemoryStream object is written into RAM, this method is redundant.
작업이 완료 되기 전에 취소 되는 경우 반환 된 작업에는 Canceled 속성에 대 한 값이 포함 됩니다 Status .If the operation is canceled before it completes, the returned task contains the Canceled value for the Status property.
클래스의 인스턴스를 만들고 CancellationTokenSource Token 속성을 매개 변수로 전달 하 여 취소 토큰을 만들 수 있습니다 cancellationToken
.You can create a cancellation token by creating an instance of the CancellationTokenSource class and passing the Token property as the cancellationToken
parameter.