write

abstract fun write(descriptor: Descriptor, buffer: ByteArray, offset: Filesize): Filesize

Write to a descriptor, without using and updating the descriptor's offset.

It is valid to write past the end of a file; the file is extended to the extent of the write, with bytes between the previous end and the start of the write set to zero.

Note: This is similar to pwrite in POSIX.

Parameters

descriptor

The descriptor to write to.

buffer

The data to write.