Instance Methodasync-http-client 1.25.2AsyncHTTPClient
collect(upTo:)
Accumulates Body
of ByteBuffer
s into a single ByteBuffer
.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
func collect(upTo maxBytes: Int) async throws -> ByteBuffer
Parameters
- maxBytes
The maximum number of bytes this method is allowed to accumulate
Returns
the number of bytes collected over time
Throws
NIOTooManyBytesError
if the the sequence contains more than maxBytes
.