Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Instance Method

write(_:)

Write a sequence of bytes.
func write(_ bytes: some Sequence<UInt8>) async throws

Discussion

Copies into contiguous storage so the bytes can be handed over as a Span<UInt8>. withContiguousStorageIfAvailable is unusable here: its closure is synchronous, and write(_ bytes: Span<UInt8>) must be awaited. Writers that copy synchronously should override.