Instance Method (Default implementation)swift-nio 2.72.0_NIOFileSystem
write(contentsOf:toAbsoluteOffset:)
Write the readable bytes of the ByteBuffer
to the open file.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
@discardableResult func write(contentsOf buffer: ByteBuffer, toAbsoluteOffset offset: Int64) async throws -> Int64
Parameters
Returns
The number of bytes written.
Throws
unsupported
if file is unseekable and offset
is not 0.
See also
func write(contentsOf: some (Sequence<UInt8> & Sendable), toAbsoluteOffset: Int64
) async throws -> Int64 Write the given bytes to the open file.
func bufferedWriter(startingAtAbsoluteOffset: Int64, capacity: ByteCount
) -> BufferedWriter<Self> Creates a new
BufferedWriter
for this file handle.
Other members in extension
Instance members
func withBufferedWriter<Result>(startingAtAbsoluteOffset: Int64, capacity: ByteCount, execute: (inout BufferedWriter<Self>) async throws -> Result
) async throws -> Result Convenience function that creates a buffered reader, executes the closure that writes the contents into the buffer and calls ‘flush()’.