writeAll(toAbsoluteOffset:_:)
Writes a sequence of bytes to the given offset.
Declaration
@discardableResult func writeAll<S>(toAbsoluteOffset offset: Int64, _ sequence: S) throws -> Int where S : Sequence, S.Element == UInt8Parameters
- offset:
The file offset where writing begins.
- sequence:
The bytes to write.
Return Value
The number of bytes written, equal to the number of elements in sequence.
Discussion
This method either writes the entire contents of sequence, or throws an error if only part of the content was written. Unlike writeAll(_:), this method preserves the file descriptor’s existing offset.
If sequence doesn’t implement the withContiguousStorageIfAvailable(_:) method, temporary space will be allocated as needed.