apple / swift-nio

Event-driven network application framework for high performance protocol servers & clients, non-blocking.
https://swiftpackageindex.com/apple/swift-nio/documentation
Apache License 2.0
7.85k stars 633 forks source link

Add a version of 'write' for 'ByteBuffer' #2730

Closed glbrntt closed 1 month ago

glbrntt commented 1 month ago

Motivation:

At the moment 'WritableFileHandleProtocol' is in terms of some Sequence<UInt8>. To use a ByteBuffer users must pass in the readable view of the buffer, which is inconvenient.

Modifications:

Result:

Easier to use API