collect(upTo:)

Accumulates Body of ByteBuffers into a single ByteBuffer.

HTTPClientResponse.swift:108
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.