You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because `read(into:)` and `write(into:)` return the number of bytes read
or written which may be smaller than desired, users will often want to
call these functions in a loop until they have read or written all the
bytes they require. Such loops require keeping track of the index and
will be repeated toil in each application.
Swift System already provides an extensions `writeAll(_:)` and
`writeAll(toAbsoluteOffset:_:)` which operates on a sequence of bytes
and writes all the bytes in the sequence.
This patch adds an analogous helper function for reading,
`read(filling buffer:)` which takes an `UnsafeMutableRawBufferPointer`
and reads until the buffer is full, or until EOF is reached.
0 commit comments