summaryrefslogtreecommitdiff
path: root/src/main/kotlin/ProtocolTranslator.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/ProtocolTranslator.kt')
-rw-r--r--src/main/kotlin/ProtocolTranslator.kt8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/kotlin/ProtocolTranslator.kt b/src/main/kotlin/ProtocolTranslator.kt
index bc64002..3dd5d70 100644
--- a/src/main/kotlin/ProtocolTranslator.kt
+++ b/src/main/kotlin/ProtocolTranslator.kt
@@ -57,9 +57,13 @@ interface ProtocolTranslator {
fun create(path: String)
/**
- * Transfer data from file.
+ * Transfer data from 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`.
+ *
+ * @return A pair of: (1) an optional error message and (2) the content read with the call just made. If the string
+ * is not null, an error occurred and the array is going to be empty.
*/
- fun read(fid: UInt, offset: ULong, count: UInt): String?
+ fun read(fid: UInt, offset: ULong, count: UInt): Pair<String?, Array<UByte>>
/**
* Transfer data to file.