Method CopyToAsync
- Namespace
- DSharpPlus.VoiceNext
- Assembly
- DSharpPlus.VoiceNext.dll
CopyToAsync(Stream, VoiceTransmitSink, int?, CancellationToken)
Asynchronously reads the bytes from the current stream and writes them to the specified VoiceTransmitSink.
public static Task CopyToAsync(this Stream source, VoiceTransmitSink destination, int? bufferSize = null, CancellationToken cancellationToken = default)
Parameters
source
StreamThe source Stream
destination
VoiceTransmitSinkThe target VoiceTransmitSink
bufferSize
int?The size, in bytes, of the buffer. This value must be greater than zero. If null, defaults to the packet size specified by
destination
.cancellationToken
CancellationTokenThe token to monitor for cancellation requests.