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

* Add a version of 'write' for 'ByteBuffer'

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:

- Add an extension to `WritableFileHandleProtocol` which takes a
  `ByteBuffer`.

Result:

Easier to use API

* fix docs
This commit is contained in:
George Barnett authored and GitHub committed 2024-05-29 14:59:06 +01:00
1 parent 9f63b12a05
commit d8bf55d693
3 files changed
+49 -1

No files matched your search

@@ -4,7 +4,8 @@
### Write bytes to a file
- ``write(contentsOf:toAbsoluteOffset:)``
- ``write(contentsOf:toAbsoluteOffset:)-57fnc``
- ``write(contentsOf:toAbsoluteOffset:)-4na03``
- ``bufferedWriter(startingAtAbsoluteOffset:capacity:)``
### Resize a file