Instance Methodswift-nio 2.72.0NIOCore->_Concurrency
collect(upTo:into:)
Accumulates an AsyncSequence
of RandomAccessCollection
s into a single accumulationBuffer
.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
func collect(upTo maxBytes: Int, into accumulationBuffer: inout ByteBuffer) async throws
Parameters
- accumulationBuffer
buffer to write all the elements of
self
into- maxBytes
The maximum number of bytes this method is allowed to write into
accumulationBuffer
Throws
NIOTooManyBytesError
if the the sequence contains more than maxBytes
. Note that previous elements of self
might already be write to accumulationBuffer
.
Other members in extension
Instance members
func collect(upTo: Int, using: ByteBufferAllocator
) async throws -> ByteBuffer Accumulates an
AsyncSequence
ofRandomAccessCollection
s into a singleByteBuffer
.