diff options
author | Edoardo La Greca | 2025-08-01 16:53:52 +0200 |
---|---|---|
committer | Edoardo La Greca | 2025-08-01 16:53:52 +0200 |
commit | 391de1ffbd961f7ae6bc4e489975ed0a645e0089 (patch) | |
tree | 84a28da2f75a689c807aa056b7cb73118b97ce45 /src/main/kotlin/NetworkPacketTransporter.kt | |
parent | 4050df8178def9df2107bab3d49ae97282f79e53 (diff) |
fix types
Diffstat (limited to 'src/main/kotlin/NetworkPacketTransporter.kt')
-rw-r--r-- | src/main/kotlin/NetworkPacketTransporter.kt | 10 |
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 |