summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/kotlin/ProtocolTranslator.kt9
1 files changed, 8 insertions, 1 deletions
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<String?, Array<UByte>>
/**
- * 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<UByte>): Pair<String?, UInt>