write(contentsOf:)
Write the contents of the AsyncSequence
of byte chunks to the buffer.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
@discardableResult mutating func write<Chunks>(contentsOf chunks: Chunks) async throws -> Int64 where Chunks : AsyncSequence, Chunks.Element : Sequence, Chunks.Element.Element == UInt8
Parameters
- chunks
The
AsyncSequence
of byte chunks to write to the buffer.
Returns
The number of bytes written into the buffered writer.
If appending a chunk to the buffer causes it to exceed the capacity of the buffer then the contents of the buffer are automatically written to the file system.
To manually flush bytes use flush
.