MemoryStream.CopyToAsync(Stream, Int32, CancellationToken) 메서드
정의
현재 스트림에서 모든 바이트를 비동기적으로 읽어 지정된 버퍼 크기 및 취소 토큰을 사용하여 다른 스트림에 씁니다.Asynchronously reads all the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.
public:
override System::Threading::Tasks::Task ^ CopyToAsync(System::IO::Stream ^ destination, int bufferSize, System::Threading::CancellationToken cancellationToken);
public override System.Threading.Tasks.Task CopyToAsync (System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken);
override this.CopyToAsync : System.IO.Stream * int * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overrides Function CopyToAsync (destination As Stream, bufferSize As Integer, cancellationToken As CancellationToken) As Task
매개 변수
- destination
- Stream
현재 스트림의 내용을 복사할 스트림입니다.The stream to which the contents of the current stream will be copied.
- bufferSize
- Int32
버퍼의 크기(바이트)입니다.The size, in bytes, of the buffer. 이 값은 0보다 커야 합니다.This value must be greater than zero.
- cancellationToken
- CancellationToken
취소 요청을 모니터링할 토큰입니다.The token to monitor for cancellation requests.
반환
비동기 복사 작업을 나타내는 작업입니다.A task that represents the asynchronous copy operation.
예외
destination
이(가) null
인 경우destination
is null
.
buffersize
가 음수이거나 0인 경우buffersize
is negative or zero.
현재 스트림이나 대상 스트림이 삭제됩니다.Either the current stream or the destination stream is disposed.
현재 스트림이 읽기를 지원하지 않거나 대상 스트림이 쓰기를 지원하지 않습니다.The current stream does not support reading, or the destination stream does not support writing.