diff options
Diffstat (limited to 'src/main/kotlin')
-rw-r--r-- | src/main/kotlin/OutMessage.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/kotlin/OutMessage.kt b/src/main/kotlin/OutMessage.kt index bc05784..9a3bcfb 100644 --- a/src/main/kotlin/OutMessage.kt +++ b/src/main/kotlin/OutMessage.kt @@ -90,7 +90,7 @@ class OutMessage(val type: NinePMessageType, val tag: UShort, val fieldNames: Li * @param tl The networking API. * @param value The number's value. */ - private fun writeInteger(tl: TransportLayer, value: BigInteger) { + fun writeInteger(tl: TransportLayer, value: BigInteger) { val bytes = value.toByteArray() tl.transmit(Array(bytes.size) { i -> bytes[i].toUByte() }) } @@ -105,7 +105,7 @@ class OutMessage(val type: NinePMessageType, val tag: UShort, val fieldNames: Li * @param value The string. * @throws IllegalArgumentException if the value of the string's size does not fit into 2 bytes. */ - private fun writeString(tl: TransportLayer, value: String) { + fun writeString(tl: TransportLayer, value: String) { require(value.length <= 2.0.pow(16.0) - 1) writeInteger(tl, value.length.toBigInteger()) val bytes = value.toByteArray() |