From 7adacdbc6afc9f2de0131c695ce8ade12a77e1dc Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 15 Nov 2019 10:38:03 +0800 Subject: [PATCH] Add JvmSynthetic --- .../kotlin/net.mamoe.mirai/utils/io/ByteArrayUtil.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/ByteArrayUtil.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/ByteArrayUtil.kt index f1b548308..12dd8341b 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/ByteArrayUtil.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/ByteArrayUtil.kt @@ -8,6 +8,7 @@ import kotlinx.io.core.ByteReadPacket import kotlinx.io.core.String import kotlinx.io.core.use import kotlin.jvm.JvmOverloads +import kotlin.jvm.JvmSynthetic @JvmOverloads fun ByteArray.toHexString(separator: String = " "): String = this.joinToString(separator) { @@ -21,9 +22,9 @@ fun ByteArray.toHexString(separator: String = " "): String = this.joinToString(s @JvmOverloads fun ByteArray.toUHexString(separator: String = " "): String = this.toUByteArray().toUHexString(separator) -fun ByteArray.stringOfWitch(charset: Charset = Charsets.UTF_8): String = String(this, charset = charset) +fun ByteArray.encodeToString(charset: Charset = Charsets.UTF_8): String = String(this, charset = charset) -//@JvmSynthetic TODO 等待 kotlin 修复 bug 后添加这个注解 +@JvmSynthetic @JvmOverloads fun UByteArray.toUHexString(separator: String = " "): String = this.joinToString(separator) { var ret = it.toString(16).toUpperCase()