summaryrefslogtreecommitdiff
path: root/src/main/kotlin/NetworkPacketTransporter.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/NetworkPacketTransporter.kt')
-rw-r--r--src/main/kotlin/NetworkPacketTransporter.kt10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/kotlin/NetworkPacketTransporter.kt b/src/main/kotlin/NetworkPacketTransporter.kt
index 4b11967..e12a6ac 100644
--- a/src/main/kotlin/NetworkPacketTransporter.kt
+++ b/src/main/kotlin/NetworkPacketTransporter.kt
@@ -10,7 +10,7 @@ import java.io.Closeable
* if the remote address is a domain name, but it cannot be resolved.
*
* Depending on the specific given implementation, the constructor of this class might throw other exceptions (e.g. the
- * [Socket] constructor from [java.net] in [NetworkPacketTransporterJavaNet]).
+ * [java.net.Socket] constructor in [NetworkPacketTransporterJavaNet]).
*/
abstract class NetworkPacketTransporter : Closeable {
val address: String
@@ -48,8 +48,8 @@ abstract class NetworkPacketTransporter : Closeable {
*
* @throws java.io.IOException if the message could not be correctly transmitted.
*/
- abstract fun transmit(payload: List<Byte>)
+ abstract fun transmit(payload: Array<UByte>)
/**
* Receive a payload until a byte occurs, which marks the end of the message. The byte is discarded after being read
* and is not returned.
@@ -64,11 +64,11 @@ abstract class NetworkPacketTransporter : Closeable {
abstract fun receiveUntil(untilByte: Byte): List<Byte>
/**
- * Receive a payload with fixed length.
+ * Receive a payload with fixed length. If zero, nothing is read.
*
* @param length The length of the message in bytes.
- *
+ * @return the received payload.
* @throws java.io.IOException if the message could not be correctly received.
*/
- abstract fun receiveFixed(length: ULong): List<Byte>
+ abstract fun receive(length: ULong): Array<UByte>
} \ No newline at end of file