From 4030d1880474e2188a01a5fd6f20c8d068e5afeb Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Wed, 6 Aug 2025 19:56:34 +0200 Subject: add documentation for write --- src/main/kotlin/ProtocolTranslator.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/ProtocolTranslator.kt b/src/main/kotlin/ProtocolTranslator.kt index e24d60c..e938224 100644 --- a/src/main/kotlin/ProtocolTranslator.kt +++ b/src/main/kotlin/ProtocolTranslator.kt @@ -66,7 +66,14 @@ interface ProtocolTranslator { fun read(fid: UInt, offset: ULong, count: UInt): Pair> /** - * Transfer data to file. + * Transfer data to file. Due to the negotiated maximum size of 9P messages, called `msize`, one is supposed to + * call this method multiple times, unless the content is smaller than `msize`. + * + * @param fid The FID to write to. + * @param offset The distance between the beginning of the file and the first written byte. + * @param data The raw bytes that are going to be written. + * @return A pair of: (1) an optional error message and (2) the amount of bytes written with the call just made. If + * the string is not null, an error occurred and the amount of written bytes is going to be zero. */ fun write(fid: UInt, offset: ULong, count: UInt, data: Iterable): Pair -- cgit v1.2.3