diff options
author | Edoardo La Greca | 2025-08-05 15:28:45 +0200 |
---|---|---|
committer | Edoardo La Greca | 2025-08-05 15:28:45 +0200 |
commit | 10d9b3c1dcce9918222b85074c8d4bda07c934f9 (patch) | |
tree | 18925858b25698a4fe37f5505d8f466a6401368c /src/main/kotlin/ProtocolTranslator.kt | |
parent | f8802d5d1164f65a5845c5c9e5d067ac5c5f9a49 (diff) |
expand doc and change return type for read method
Diffstat (limited to 'src/main/kotlin/ProtocolTranslator.kt')
-rw-r--r-- | src/main/kotlin/ProtocolTranslator.kt | 8 |
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. |