Bläddra i källkod

Use ktor-io to replace kotlinx-io

Him188 3 år sedan
förälder
incheckning
ce87400998
100 ändrade filer med 289 tillägg och 299 borttagningar
  1. 1 1
      buildSrc/src/main/kotlin/ProjectConfigure.kt
  2. 2 0
      buildSrc/src/main/kotlin/Versions.kt
  3. 1 3
      mirai-core-api/build.gradle.kts
  4. 2 2
      mirai-core-api/src/commonMain/kotlin/contact/file/AbsoluteFile.kt
  5. 2 2
      mirai-core-api/src/commonMain/kotlin/contact/file/AbsoluteFileFolder.kt
  6. 1 1
      mirai-core-api/src/commonMain/kotlin/message/data/CustomMessage.kt
  7. 1 1
      mirai-core-api/src/commonMain/kotlin/spi/AudioToSilkService.kt
  8. 1 1
      mirai-core-api/src/commonMain/kotlin/utils/DeviceInfo.kt
  9. 1 1
      mirai-core-api/src/commonMain/kotlin/utils/ExternalResource.kt
  10. 1 1
      mirai-core-api/src/commonMain/kotlin/utils/FileCacheStrategy.kt
  11. 5 2
      mirai-core-api/src/jvmBaseMain/kotlin/internal/utils/ExternalResourceImpls.kt
  12. 1 1
      mirai-core-api/src/jvmBaseMain/kotlin/utils/AbstractExternalResource.kt
  13. 1 1
      mirai-core-api/src/jvmBaseMain/kotlin/utils/DeviceInfo.kt
  14. 4 2
      mirai-core-api/src/jvmBaseMain/kotlin/utils/ExternalResource.kt
  15. 1 1
      mirai-core-api/src/nativeMain/kotlin/utils/BotConfiguration.kt
  16. 1 1
      mirai-core-api/src/nativeMain/kotlin/utils/DeviceInfo.kt
  17. 1 1
      mirai-core-api/src/nativeMain/kotlin/utils/ExternalResource.kt
  18. 1 3
      mirai-core-utils/build.gradle.kts
  19. 1 1
      mirai-core-utils/src/commonMain/kotlin/ByteArrayPool.kt
  20. 1 1
      mirai-core-utils/src/commonMain/kotlin/Bytes.kt
  21. 1 1
      mirai-core-utils/src/commonMain/kotlin/Closeable.kt
  22. 2 3
      mirai-core-utils/src/commonMain/kotlin/IO.kt
  23. 2 3
      mirai-core-utils/src/commonMain/kotlin/MiraiPlatformUtils.kt
  24. 1 1
      mirai-core-utils/src/jvmBaseMain/kotlin/Crypto.kt
  25. 1 1
      mirai-core-utils/src/nativeMain/kotlin/Closeable.kt
  26. 1 3
      mirai-core/build.gradle.kts
  27. 1 2
      mirai-core/src/commonMain/kotlin/MiraiImpl.kt
  28. 1 0
      mirai-core/src/commonMain/kotlin/message/ReceiveMessageHandler.kt
  29. 9 0
      mirai-core/src/commonMain/kotlin/message/atImpl.kt
  30. 1 1
      mirai-core/src/commonMain/kotlin/message/data/audio.kt
  31. 9 0
      mirai-core/src/commonMain/kotlin/message/faceImpl.kt
  32. 2 2
      mirai-core/src/commonMain/kotlin/message/image/ImageDecoder.kt
  33. 1 1
      mirai-core/src/commonMain/kotlin/message/protocol/impl/FaceProtocol.kt
  34. 1 1
      mirai-core/src/commonMain/kotlin/message/protocol/impl/FileMessageProtocol.kt
  35. 1 1
      mirai-core/src/commonMain/kotlin/message/protocol/impl/RichMessageProtocol.kt
  36. 1 4
      mirai-core/src/commonMain/kotlin/message/protocol/impl/TextProtocol.kt
  37. 5 6
      mirai-core/src/commonMain/kotlin/network/QQAndroidClient.kt
  38. 1 1
      mirai-core/src/commonMain/kotlin/network/components/AccountSecretsManager.kt
  39. 1 1
      mirai-core/src/commonMain/kotlin/network/components/PacketCodec.kt
  40. 5 5
      mirai-core/src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt
  41. 4 6
      mirai-core/src/commonMain/kotlin/network/highway/Highway.kt
  42. 1 3
      mirai-core/src/commonMain/kotlin/network/keys.kt
  43. 5 7
      mirai-core/src/commonMain/kotlin/network/notice/decoders/MsgInfoDecoder.kt
  44. 2 3
      mirai-core/src/commonMain/kotlin/network/notice/group/GroupNotificationProcessor.kt
  45. 5 7
      mirai-core/src/commonMain/kotlin/network/notice/group/GroupOrMemberListNoticeProcessor.kt
  46. 1 3
      mirai-core/src/commonMain/kotlin/network/notice/priv/FriendNoticeProcessor.kt
  47. 8 8
      mirai-core/src/commonMain/kotlin/network/protocol/packet/EncryptMethod.kt
  48. 1 1
      mirai-core/src/commonMain/kotlin/network/protocol/packet/OutgoingPacket.kt
  49. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/PacketFactory.kt
  50. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/Tlv.kt
  51. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/GroupFile.kt
  52. 1 1
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/MultiMsg.kt
  53. 1 1
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/MusicSharePacket.kt
  54. 5 6
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/NewContact.kt
  55. 1 2
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/NudgePacket.kt
  56. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/PbMessageSvc.kt
  57. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/TroopEssenceMsgManager.kt
  58. 1 4
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/TroopManagement.kt
  59. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/image/ImgStore.kt
  60. 1 1
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/image/LongConn.kt
  61. 1 1
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PbDeleteMsg.kt
  62. 1 1
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PbGetMsg.kt
  63. 2 2
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PbGetRoamMsgReq.kt
  64. 1 2
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PbSendMsg.kt
  65. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PushForceOffline.kt
  66. 2 3
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PushNotify.kt
  67. 2 2
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PushReaded.kt
  68. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.RequestPushStatus.kt
  69. 2 2
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/OnlinePush.PbC2CMsgSync.kt
  70. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/OnlinePush.PbPushGroupMsg.kt
  71. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/OnlinePush.PbPushTransMsg.kt
  72. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt
  73. 1 1
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/OnlinePush.SidExpired.kt
  74. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/voice/PttStore.kt
  75. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/list/FriendList.kt
  76. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/list/ProfileService.kt
  77. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/list/StrangerList.kt
  78. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/login/ConfigPushSvc.kt
  79. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/login/Heartbeat.kt
  80. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/login/StatSvc.kt
  81. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt
  82. 5 4
      mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLogin10.kt
  83. 5 4
      mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLogin15.kt
  84. 1 0
      mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLogin2.kt
  85. 5 5
      mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLogin9.kt
  86. 1 1
      mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLoginExt.kt
  87. 5 6
      mirai-core/src/commonMain/kotlin/network/protocol/packet/summarycard/SummaryCard.kt
  88. 4 5
      mirai-core/src/commonMain/kotlin/utils/PlatformDatagramChannel.kt
  89. 7 10
      mirai-core/src/commonMain/kotlin/utils/PlatformSocket.kt
  90. 2 2
      mirai-core/src/commonMain/kotlin/utils/crypto/TEA.kt
  91. 3 3
      mirai-core/src/commonMain/kotlin/utils/io/output.kt
  92. 2 3
      mirai-core/src/commonMain/kotlin/utils/io/serialization/tars/Tars.kt
  93. 2 2
      mirai-core/src/commonMain/kotlin/utils/io/serialization/tars/internal/TarsInput.kt
  94. 6 7
      mirai-core/src/commonMain/kotlin/utils/io/serialization/tars/internal/TarsOld.kt
  95. 2 2
      mirai-core/src/commonMain/kotlin/utils/io/serialization/tars/internal/TarsTag.kt
  96. 2 2
      mirai-core/src/commonMain/kotlin/utils/io/serialization/utils.kt
  97. 5 5
      mirai-core/src/commonTest/kotlin/PlatformUtilsTest.kt
  98. 1 1
      mirai-core/src/commonTest/kotlin/message/protocol/impl/AbstractMessageProtocolTest.kt
  99. 5 6
      mirai-core/src/commonTest/kotlin/network/framework/AbstractNettyNHTest.kt
  100. 5 5
      mirai-core/src/commonTest/kotlin/network/impl/netty/NettyResumeConnectionTest.kt

+ 1 - 1
buildSrc/src/main/kotlin/ProjectConfigure.kt

@@ -173,7 +173,7 @@ val experimentalAnnotations = arrayOf(
     "net.mamoe.mirai.console.util.ConsoleInternalApi",
     "net.mamoe.mirai.console.util.ConsoleExperimentalApi",
 
-    "kotlinx.io.core.internal.DangerousInternalIoApi"
+    "io.ktor.utils.io.core.internal.DangerousInternalIoApi"
 )
 
 fun Project.configureKotlinExperimentalUsages() {

+ 2 - 0
buildSrc/src/main/kotlin/Versions.kt

@@ -84,6 +84,8 @@ val `kotlinx-io-common` = kotlinx("io", Versions.io)
 val `kotlinx-io-jvm` = kotlinx("io-jvm", Versions.io)
 val `kotlinx-io-native` = kotlinx("io-macosx64", Versions.io)
 
+val `ktor-io` = ktor("io", Versions.ktor)
+
 fun KotlinDependencyHandler.implementationKotlinxIo(module: String) {
     implementation(module) {
         /*

+ 1 - 3
mirai-core-api/build.gradle.kts

@@ -41,7 +41,7 @@ kotlin {
                 implementation(project(":mirai-console-compiler-annotations"))
                 implementation(`kotlinx-serialization-protobuf`)
                 implementation(`kotlinx-atomicfu`)
-                implementationKotlinxIo(`kotlinx-io-common`)
+                implementation(`ktor-io`)
             }
         }
 
@@ -58,7 +58,6 @@ kotlin {
                 implementation(`jetbrains-annotations`)
                 implementation(`log4j-api`)
                 compileOnly(`slf4j-api`)
-                implementationKotlinxIo(`kotlinx-io-jvm`)
             }
         }
 
@@ -84,7 +83,6 @@ kotlin {
 
         val nativeMain by getting {
             dependencies {
-                implementationKotlinxIo(`kotlinx-io-native`)
             }
         }
     }

+ 2 - 2
mirai-core-api/src/commonMain/kotlin/contact/file/AbsoluteFile.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -12,7 +12,7 @@
 
 package net.mamoe.mirai.contact.file
 
-import kotlinx.io.errors.IOException
+import io.ktor.utils.io.errors.*
 import me.him188.kotlin.jvm.blocking.bridge.JvmBlockingBridge
 import net.mamoe.mirai.contact.PermissionDeniedException
 import net.mamoe.mirai.message.data.FileMessage

+ 2 - 2
mirai-core-api/src/commonMain/kotlin/contact/file/AbsoluteFileFolder.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -12,7 +12,7 @@
 
 package net.mamoe.mirai.contact.file
 
-import kotlinx.io.errors.IOException
+import io.ktor.utils.io.errors.*
 import me.him188.kotlin.jvm.blocking.bridge.JvmBlockingBridge
 import net.mamoe.mirai.contact.FileSupported
 import net.mamoe.mirai.contact.PermissionDeniedException

+ 1 - 1
mirai-core-api/src/commonMain/kotlin/message/data/CustomMessage.kt

@@ -11,7 +11,7 @@
 
 package net.mamoe.mirai.message.data
 
-import kotlinx.io.core.*
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.KSerializer
 import kotlinx.serialization.Serializable
 import kotlinx.serialization.json.Json

+ 1 - 1
mirai-core-api/src/commonMain/kotlin/spi/AudioToSilkService.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.spi
 
-import kotlinx.io.errors.IOException
+import io.ktor.utils.io.errors.*
 import net.mamoe.mirai.utils.*
 import kotlin.coroutines.cancellation.CancellationException
 import kotlin.jvm.JvmStatic

+ 1 - 1
mirai-core-api/src/commonMain/kotlin/utils/DeviceInfo.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.utils
 
-import kotlinx.io.core.toByteArray
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.KSerializer
 import kotlinx.serialization.Serializable
 import kotlinx.serialization.Serializer

+ 1 - 1
mirai-core-api/src/commonMain/kotlin/utils/ExternalResource.kt

@@ -11,9 +11,9 @@
 
 package net.mamoe.mirai.utils
 
+import io.ktor.utils.io.core.*
 import kotlinx.coroutines.CompletableDeferred
 import kotlinx.coroutines.Deferred
-import kotlinx.io.core.Input
 import me.him188.kotlin.jvm.blocking.bridge.JvmBlockingBridge
 import net.mamoe.mirai.contact.Contact
 import net.mamoe.mirai.contact.Contact.Companion.sendImage

+ 1 - 1
mirai-core-api/src/commonMain/kotlin/utils/FileCacheStrategy.kt

@@ -11,8 +11,8 @@
 
 package net.mamoe.mirai.utils
 
+import io.ktor.utils.io.errors.*
 import kotlinx.coroutines.Dispatchers
-import kotlinx.io.errors.IOException
 import net.mamoe.mirai.Bot
 import net.mamoe.mirai.IMirai
 import net.mamoe.mirai.utils.ExternalResource.Companion.sendAsImageTo

+ 5 - 2
mirai-core-api/src/jvmBaseMain/kotlin/internal/utils/ExternalResourceImpls.kt

@@ -9,15 +9,18 @@
 
 package net.mamoe.mirai.internal.utils
 
+import io.ktor.utils.io.core.Input
+import io.ktor.utils.io.streams.*
 import kotlinx.atomicfu.atomic
 import kotlinx.coroutines.CompletableDeferred
 import kotlinx.coroutines.Deferred
-import kotlinx.io.core.Input
-import kotlinx.io.streams.asInput
 import net.mamoe.mirai.utils.*
 import java.io.Closeable
 import java.io.InputStream
 import java.io.RandomAccessFile
+import kotlin.io.buffered
+import kotlin.io.inputStream
+import kotlin.io.use
 
 
 internal fun InputStream.detectFileTypeAndClose(): String? {

+ 1 - 1
mirai-core-api/src/jvmBaseMain/kotlin/utils/AbstractExternalResource.kt

@@ -9,10 +9,10 @@
 
 package net.mamoe.mirai.utils
 
+import io.ktor.utils.io.errors.*
 import kotlinx.atomicfu.atomic
 import kotlinx.coroutines.CompletableDeferred
 import kotlinx.coroutines.Deferred
-import kotlinx.io.errors.IOException
 import net.mamoe.mirai.internal.utils.ExternalResourceHolder
 import net.mamoe.mirai.internal.utils.ExternalResourceLeakObserver
 import net.mamoe.mirai.internal.utils.detectFileTypeAndClose

+ 1 - 1
mirai-core-api/src/jvmBaseMain/kotlin/utils/DeviceInfo.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.utils
 
-import kotlinx.io.core.toByteArray
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.Serializable
 import kotlinx.serialization.Transient
 import kotlinx.serialization.json.Json

+ 4 - 2
mirai-core-api/src/jvmBaseMain/kotlin/utils/ExternalResource.kt

@@ -9,10 +9,10 @@
 
 package net.mamoe.mirai.utils
 
+import io.ktor.utils.io.core.Input
+import io.ktor.utils.io.errors.*
 import kotlinx.coroutines.CompletableDeferred
 import kotlinx.coroutines.Deferred
-import kotlinx.io.core.Input
-import kotlinx.io.errors.IOException
 import me.him188.kotlin.jvm.blocking.bridge.JvmBlockingBridge
 import net.mamoe.mirai.Mirai
 import net.mamoe.mirai.contact.Contact
@@ -34,6 +34,8 @@ import net.mamoe.mirai.utils.ExternalResource.Companion.uploadAsImage
 import java.io.File
 import java.io.InputStream
 import java.io.RandomAccessFile
+import kotlin.io.inputStream
+import kotlin.io.use
 
 /**
  * 一个*不可变的*外部资源. 仅包含资源内容, 大小, 文件类型, 校验值而不包含文件名, 文件位置等. 外部资源有可能是一个文件, 也有可能只存在于内存, 或者以任意其他方式实现.

+ 1 - 1
mirai-core-api/src/nativeMain/kotlin/utils/BotConfiguration.kt

@@ -9,9 +9,9 @@
 
 package net.mamoe.mirai.utils
 
+import io.ktor.utils.io.core.*
 import kotlinx.coroutines.Job
 import kotlinx.coroutines.SupervisorJob
-import kotlinx.io.core.Input
 import kotlinx.serialization.json.Json
 import net.mamoe.mirai.Bot
 import net.mamoe.mirai.BotFactory

+ 1 - 1
mirai-core-api/src/nativeMain/kotlin/utils/DeviceInfo.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.utils
 
-import kotlinx.io.core.toByteArray
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.Serializable
 import kotlinx.serialization.Transient
 import kotlin.random.Random

+ 1 - 1
mirai-core-api/src/nativeMain/kotlin/utils/ExternalResource.kt

@@ -9,9 +9,9 @@
 
 package net.mamoe.mirai.utils
 
+import io.ktor.utils.io.core.*
 import kotlinx.coroutines.CompletableDeferred
 import kotlinx.coroutines.Deferred
-import kotlinx.io.core.Input
 import net.mamoe.mirai.contact.Contact
 import net.mamoe.mirai.contact.Contact.Companion.sendImage
 import net.mamoe.mirai.contact.Contact.Companion.uploadImage

+ 1 - 3
mirai-core-utils/build.gradle.kts

@@ -35,7 +35,7 @@ kotlin {
 
                 implementation(`kotlinx-atomicfu`)
                 implementation(`kotlinx-serialization-protobuf`)
-                implementationKotlinxIo(`kotlinx-io-common`)
+                implementation(`ktor-io`)
             }
         }
 
@@ -47,7 +47,6 @@ kotlin {
 
         val jvmBaseMain by getting {
             dependencies {
-                implementationKotlinxIo(`kotlinx-io-jvm`)
             }
         }
 
@@ -71,7 +70,6 @@ kotlin {
 
         val nativeMain by getting {
             dependencies {
-                implementationKotlinxIo(`kotlinx-io-native`)
             }
         }
     }

+ 1 - 1
mirai-core-utils/src/commonMain/kotlin/ByteArrayPool.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.utils
 
-import kotlinx.io.pool.DefaultPool
+import io.ktor.utils.io.pool.*
 
 /**
  * 缓存 [ByteArray] 实例的 [ObjectPool]

+ 1 - 1
mirai-core-utils/src/commonMain/kotlin/Bytes.kt

@@ -13,7 +13,7 @@
 
 package net.mamoe.mirai.utils
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import kotlin.contracts.InvocationKind
 import kotlin.contracts.contract
 import kotlin.jvm.JvmMultifileClass

+ 1 - 1
mirai-core-utils/src/commonMain/kotlin/Closeable.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.utils
 
-import kotlinx.io.errors.IOException
+import io.ktor.utils.io.errors.*
 
 public expect interface Closeable {
     @Throws(IOException::class)

+ 2 - 3
mirai-core-utils/src/commonMain/kotlin/IO.kt

@@ -14,9 +14,8 @@
 
 package net.mamoe.mirai.utils
 
-import kotlinx.io.charsets.Charset
-import kotlinx.io.charsets.Charsets
-import kotlinx.io.core.*
+import io.ktor.utils.io.charsets.*
+import io.ktor.utils.io.core.*
 import kotlin.jvm.JvmMultifileClass
 import kotlin.jvm.JvmName
 import kotlin.jvm.JvmSynthetic

+ 2 - 3
mirai-core-utils/src/commonMain/kotlin/MiraiPlatformUtils.kt

@@ -12,9 +12,8 @@
 
 package net.mamoe.mirai.utils
 
-import kotlinx.io.core.Closeable
-import kotlinx.io.core.toByteArray
-import kotlinx.io.core.use
+import io.ktor.utils.io.core.*
+import io.ktor.utils.io.core.Closeable
 import kotlin.contracts.InvocationKind
 import kotlin.contracts.contract
 import kotlin.jvm.JvmMultifileClass

+ 1 - 1
mirai-core-utils/src/jvmBaseMain/kotlin/Crypto.kt

@@ -12,7 +12,7 @@
 
 package net.mamoe.mirai.utils
 
-import kotlinx.io.core.use
+import io.ktor.utils.io.core.*
 import java.io.ByteArrayOutputStream
 import java.io.InputStream
 import java.io.OutputStream

+ 1 - 1
mirai-core-utils/src/nativeMain/kotlin/Closeable.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.utils
 
-import kotlinx.io.errors.IOException
+import io.ktor.utils.io.errors.*
 
 public actual interface Closeable {
     @Throws(IOException::class)

+ 1 - 3
mirai-core/build.gradle.kts

@@ -39,7 +39,7 @@ kotlin {
                 implementation(project(":mirai-core-utils"))
                 implementation(`kotlinx-serialization-protobuf`)
                 implementation(`kotlinx-atomicfu`)
-                implementationKotlinxIo(`kotlinx-io-common`)
+                implementation(`ktor-io`)
             }
         }
 
@@ -55,7 +55,6 @@ kotlin {
                 implementation(bouncycastle)
                 implementation(`log4j-api`)
                 implementation(`netty-all`)
-                implementationKotlinxIo(`kotlinx-io-jvm`)
             }
         }
 
@@ -93,7 +92,6 @@ kotlin {
 
         val nativeMain by getting {
             dependencies {
-                implementationKotlinxIo(`kotlinx-io-native`)
             }
         }
     }

+ 1 - 2
mirai-core/src/commonMain/kotlin/MiraiImpl.kt

@@ -14,8 +14,7 @@ import io.ktor.client.engine.okhttp.*
 import io.ktor.client.features.*
 import io.ktor.client.request.*
 import io.ktor.client.request.forms.*
-import kotlinx.io.core.discardExact
-import kotlinx.io.core.readBytes
+import io.ktor.utils.io.core.readBytes
 import kotlinx.serialization.json.Json
 import kotlinx.serialization.json.JsonObject
 import kotlinx.serialization.json.jsonPrimitive

+ 1 - 0
mirai-core/src/commonMain/kotlin/message/ReceiveMessageHandler.kt

@@ -9,6 +9,7 @@
 
 package net.mamoe.mirai.internal.message
 
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.Bot
 import net.mamoe.mirai.internal.message.DeepMessageRefiner.refineDeep
 import net.mamoe.mirai.internal.message.LightMessageRefiner.refineLight

+ 9 - 0
mirai-core/src/commonMain/kotlin/message/atImpl.kt

@@ -0,0 +1,9 @@
+/*
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
+ *
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ *
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
+ */
+

+ 1 - 1
mirai-core/src/commonMain/kotlin/message/data/audio.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.message.data
 
-import kotlinx.io.core.toByteArray
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.KSerializer
 import kotlinx.serialization.SerialName
 import kotlinx.serialization.Serializable

+ 9 - 0
mirai-core/src/commonMain/kotlin/message/faceImpl.kt

@@ -0,0 +1,9 @@
+/*
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
+ *
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ *
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
+ */
+

+ 2 - 2
mirai-core/src/commonMain/kotlin/message/image/ImageDecoder.kt

@@ -9,8 +9,8 @@
 
 package net.mamoe.mirai.internal.message.image
 
-import kotlinx.io.core.*
-import kotlinx.io.streams.asInput
+import io.ktor.utils.io.core.*
+import io.ktor.utils.io.streams.asInput
 import net.mamoe.mirai.message.data.ImageType
 import net.mamoe.mirai.utils.*
 import java.io.IOException

+ 1 - 1
mirai-core/src/commonMain/kotlin/message/protocol/impl/FaceProtocol.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.message.protocol.impl
 
-import kotlinx.io.core.toByteArray
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.message.protocol.MessageProtocol
 import net.mamoe.mirai.internal.message.protocol.ProcessorCollector
 import net.mamoe.mirai.internal.message.protocol.decode.MessageDecoder

+ 1 - 1
mirai-core/src/commonMain/kotlin/message/protocol/impl/FileMessageProtocol.kt

@@ -9,9 +9,9 @@
 
 package net.mamoe.mirai.internal.message.protocol.impl
 
+import io.ktor.utils.io.core.*
 import kotlinx.coroutines.async
 import kotlinx.coroutines.coroutineScope
-import kotlinx.io.core.readUShort
 import net.mamoe.mirai.internal.contact.SendMessageStep
 import net.mamoe.mirai.internal.message.data.FileMessageImpl
 import net.mamoe.mirai.internal.message.data.checkIsImpl

+ 1 - 1
mirai-core/src/commonMain/kotlin/message/protocol/impl/RichMessageProtocol.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.message.protocol.impl
 
-import kotlinx.io.core.toByteArray
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.message.data.ForwardMessageInternal
 import net.mamoe.mirai.internal.message.data.LightAppInternal
 import net.mamoe.mirai.internal.message.data.LongMessageInternal

+ 1 - 4
mirai-core/src/commonMain/kotlin/message/protocol/impl/TextProtocol.kt

@@ -9,10 +9,7 @@
 
 package net.mamoe.mirai.internal.message.protocol.impl
 
-import kotlinx.io.core.buildPacket
-import kotlinx.io.core.discardExact
-import kotlinx.io.core.readBytes
-import kotlinx.io.core.readUInt
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.contact.Group
 import net.mamoe.mirai.contact.nameCardOrNick
 import net.mamoe.mirai.internal.message.protocol.MessageProtocol

+ 5 - 6
mirai-core/src/commonMain/kotlin/network/QQAndroidClient.kt

@@ -1,20 +1,19 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 @file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_API_USAGE", "DEPRECATION_ERROR", "unused")
 
 package net.mamoe.mirai.internal.network
 
+import io.ktor.utils.io.core.*
 import kotlinx.atomicfu.AtomicInt
 import kotlinx.atomicfu.atomic
-import kotlinx.io.core.String
-import kotlinx.io.core.toByteArray
 import net.mamoe.mirai.data.OnlineStatus
 import net.mamoe.mirai.internal.BotAccount
 import net.mamoe.mirai.internal.QQAndroidBot

+ 1 - 1
mirai-core/src/commonMain/kotlin/network/components/AccountSecretsManager.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.network.components
 
-import kotlinx.io.core.toByteArray
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.Serializable
 import net.mamoe.mirai.Bot
 import net.mamoe.mirai.internal.BotAccount

+ 1 - 1
mirai-core/src/commonMain/kotlin/network/components/PacketCodec.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.network.components
 
-import kotlinx.io.core.*
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.QQAndroidClient
 import net.mamoe.mirai.internal.network.component.ComponentKey

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt

@@ -1,17 +1,17 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.highway
 
+import io.ktor.utils.io.core.*
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.flow
-import kotlinx.io.core.Closeable
 import net.mamoe.mirai.utils.runBIO
 import net.mamoe.mirai.utils.toLongUnsigned
 import net.mamoe.mirai.utils.withUse

+ 4 - 6
mirai-core/src/commonMain/kotlin/network/highway/Highway.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -9,16 +9,14 @@
 
 package net.mamoe.mirai.internal.network.highway
 
+import io.ktor.utils.io.core.ByteReadPacket
+import io.ktor.utils.io.core.buildPacket
+import io.ktor.utils.io.core.writeFully
 import kotlinx.coroutines.*
 import kotlinx.coroutines.channels.Channel
 import kotlinx.coroutines.channels.ReceiveChannel
 import kotlinx.coroutines.flow.Flow
-import kotlinx.coroutines.flow.collect
 import kotlinx.coroutines.flow.produceIn
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.buildPacket
-import kotlinx.io.core.discardExact
-import kotlinx.io.core.writeFully
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.asQQAndroidBot
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 1 - 3
mirai-core/src/commonMain/kotlin/network/keys.kt

@@ -9,9 +9,7 @@
 
 package net.mamoe.mirai.internal.network
 
-import kotlinx.io.core.BytePacketBuilder
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.writeFully
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.SerialName
 import kotlinx.serialization.Serializable
 import net.mamoe.mirai.internal.AbstractBot

+ 5 - 7
mirai-core/src/commonMain/kotlin/network/notice/decoders/MsgInfoDecoder.kt

@@ -1,17 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.notice.decoders
 
-import kotlinx.io.core.discardExact
-import kotlinx.io.core.readBytes
-import kotlinx.io.core.readUInt
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.contact.GroupImpl
 import net.mamoe.mirai.internal.contact.checkIsGroupImpl
 import net.mamoe.mirai.internal.getGroupByUin

+ 2 - 3
mirai-core/src/commonMain/kotlin/network/notice/group/GroupNotificationProcessor.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -9,8 +9,7 @@
 
 package net.mamoe.mirai.internal.network.notice.group
 
-import kotlinx.io.core.readUInt
-import kotlinx.io.core.readUShort
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.contact.NormalMember
 import net.mamoe.mirai.contact.getMember
 import net.mamoe.mirai.data.GroupHonorType

+ 5 - 7
mirai-core/src/commonMain/kotlin/network/notice/group/GroupOrMemberListNoticeProcessor.kt

@@ -1,20 +1,18 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.notice.group
 
+import io.ktor.utils.io.core.*
 import kotlinx.coroutines.CancellationException
 import kotlinx.coroutines.cancel
 import kotlinx.coroutines.sync.withLock
-import kotlinx.io.core.discardExact
-import kotlinx.io.core.readUByte
-import kotlinx.io.core.readUInt
 import net.mamoe.mirai.Mirai
 import net.mamoe.mirai.contact.MemberPermission.*
 import net.mamoe.mirai.event.events.*

+ 1 - 3
mirai-core/src/commonMain/kotlin/network/notice/priv/FriendNoticeProcessor.kt

@@ -9,9 +9,7 @@
 
 package net.mamoe.mirai.internal.network.notice.priv
 
-import kotlinx.io.core.discardExact
-import kotlinx.io.core.readUByte
-import kotlinx.io.core.readUShort
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.Serializable
 import kotlinx.serialization.protobuf.ProtoNumber
 import net.mamoe.mirai.contact.User

+ 8 - 8
mirai-core/src/commonMain/kotlin/network/protocol/packet/EncryptMethod.kt

@@ -1,18 +1,18 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet
 
-import kotlinx.io.core.BytePacketBuilder
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.buildPacket
-import kotlinx.io.core.writeFully
+import io.ktor.utils.io.core.BytePacketBuilder
+import io.ktor.utils.io.core.ByteReadPacket
+import io.ktor.utils.io.core.buildPacket
+import io.ktor.utils.io.core.writeFully
 import net.mamoe.mirai.internal.network.QQAndroidClient
 import net.mamoe.mirai.internal.utils.crypto.ECDHKeyPair
 import net.mamoe.mirai.internal.utils.crypto.ECDHWithPublicKey

+ 1 - 1
mirai-core/src/commonMain/kotlin/network/protocol/packet/OutgoingPacket.kt

@@ -10,7 +10,7 @@
 package net.mamoe.mirai.internal.network.protocol.packet
 
 
-import kotlinx.io.core.*
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.QQAndroidClient
 import net.mamoe.mirai.internal.network.appClientVersion

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/PacketFactory.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.event.Event
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/Tlv.kt

@@ -1,17 +1,17 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 @file:Suppress("NOTHING_TO_INLINE")
 
 package net.mamoe.mirai.internal.network.protocol.packet
 
-import kotlinx.io.core.*
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.network.*
 import net.mamoe.mirai.internal.network.protocol.LoginType
 import net.mamoe.mirai.internal.utils.GuidSource

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/GroupFile.kt

@@ -1,17 +1,17 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 @file:Suppress("NOTHING_TO_INLINE")
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.DeserializationStrategy
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet

+ 1 - 1
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/MultiMsg.kt

@@ -11,7 +11,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.message.contextualBugReportException
 import net.mamoe.mirai.internal.network.Packet

+ 1 - 1
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/MusicSharePacket.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 5 - 6
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/NewContact.kt

@@ -1,18 +1,17 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 @file:Suppress("INVISIBLE_MEMBER")
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat
 
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.readBytes
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.event.events.NewFriendRequestEvent
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet

+ 1 - 2
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/NudgePacket.kt

@@ -9,8 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat
 
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.readBytes
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/PbMessageSvc.kt

@@ -1,17 +1,17 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 @file:Suppress("EXPERIMENTAL_API_USAGE")
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/TroopEssenceMsgManager.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 1 - 4
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/TroopManagement.kt

@@ -9,10 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat
 
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.buildPacket
-import kotlinx.io.core.readBytes
-import kotlinx.io.core.toByteArray
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.contact.Member
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.contact.info.GroupInfoImpl

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/image/ImgStore.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.image
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 1 - 1
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/image/LongConn.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.image
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 1 - 1
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PbDeleteMsg.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.QQAndroidClient
 import net.mamoe.mirai.internal.network.protocol.data.proto.MsgComm

+ 1 - 1
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PbGetMsg.kt

@@ -11,10 +11,10 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
+import io.ktor.utils.io.core.*
 import kotlinx.coroutines.CoroutineName
 import kotlinx.coroutines.delay
 import kotlinx.coroutines.launch
-import kotlinx.io.core.ByteReadPacket
 import net.mamoe.mirai.Bot
 import net.mamoe.mirai.event.AbstractEvent
 import net.mamoe.mirai.event.events.BotEvent

+ 2 - 2
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PbGetRoamMsgReq.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 1 - 2
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PbSendMsg.kt

@@ -9,10 +9,9 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
+import io.ktor.utils.io.core.*
 import kotlinx.coroutines.CompletableDeferred
 import kotlinx.coroutines.Deferred
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.toByteArray
 import net.mamoe.mirai.contact.Friend
 import net.mamoe.mirai.contact.Group
 import net.mamoe.mirai.contact.Member

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PushForceOffline.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.components.AccountSecretsManager
 import net.mamoe.mirai.internal.network.components.BotInitProcessor

+ 2 - 3
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PushNotify.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -9,9 +9,8 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
+import io.ktor.utils.io.core.*
 import kotlinx.atomicfu.loop
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.discardExact
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.components.SyncController.Companion.syncController
 import net.mamoe.mirai.internal.network.protocol.data.jce.RequestPushNotify

+ 2 - 2
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.PushReaded.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.protocol.packet.IncomingPacketFactory

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/MessageSvc.RequestPushStatus.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.components.NoticeProcessorPipeline.Companion.processPacketThroughPipeline

+ 2 - 2
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/OnlinePush.PbC2CMsgSync.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.components.NoticePipelineContext.Companion.KEY_FROM_SYNC

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/OnlinePush.PbPushGroupMsg.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.components.NoticeProcessorPipeline.Companion.processPacketThroughPipeline

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/OnlinePush.PbPushTransMsg.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.components.NoticeProcessorPipeline.Companion.processPacketThroughPipeline

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.MultiPacket
 import net.mamoe.mirai.internal.network.Packet

+ 1 - 1
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/receive/OnlinePush.SidExpired.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.protocol.packet.IncomingPacketFactory

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/voice/PttStore.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.chat.voice
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.contact.uin
 import net.mamoe.mirai.internal.network.Packet

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/list/FriendList.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.list
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.contact.Friend
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.contact.uin

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/list/ProfileService.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.list
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/list/StrangerList.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.list
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.contact.Stranger
 import net.mamoe.mirai.event.broadcast
 import net.mamoe.mirai.event.events.StrangerRelationChangeEvent

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/login/ConfigPushSvc.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.login
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.event.AbstractEvent
 import net.mamoe.mirai.event.Event
 import net.mamoe.mirai.event.events.BotOfflineEvent

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/login/Heartbeat.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.login
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/login/StatSvc.kt

@@ -1,10 +1,10 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.login
@@ -13,7 +13,7 @@ import kotlinx.coroutines.CancellationException
 import kotlinx.coroutines.cancel
 import kotlinx.coroutines.delay
 import kotlinx.coroutines.sync.withLock
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.ByteReadPacket
 import kotlinx.serialization.protobuf.ProtoBuf
 import net.mamoe.mirai.Mirai
 import net.mamoe.mirai.contact.ClientKind

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt

@@ -1,16 +1,16 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.login
 
 
-import kotlinx.io.core.*
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.Bot
 import net.mamoe.mirai.event.AbstractEvent
 import net.mamoe.mirai.event.events.BotEvent

+ 5 - 4
mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLogin10.kt

@@ -1,14 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.login.wtlogin
 
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.network.*
 import net.mamoe.mirai.internal.network.protocol.packet.*
 import net.mamoe.mirai.internal.network.protocol.packet.login.WtLogin

+ 5 - 4
mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLogin15.kt

@@ -1,14 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.login.wtlogin
 
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.network.*
 import net.mamoe.mirai.internal.network.protocol.packet.*
 import net.mamoe.mirai.internal.network.protocol.packet.login.WtLogin

+ 1 - 0
mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLogin2.kt

@@ -9,6 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.login.wtlogin
 
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.network.QQAndroidClient
 import net.mamoe.mirai.internal.network.miscBitMap
 import net.mamoe.mirai.internal.network.protocol.packet.*

+ 5 - 5
mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLogin9.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.login.wtlogin
 
-import kotlinx.io.core.toByteArray
+import io.ktor.utils.io.core.toByteArray
 import net.mamoe.mirai.internal.network.*
 import net.mamoe.mirai.internal.network.protocol.packet.*
 import net.mamoe.mirai.internal.network.protocol.packet.login.WtLogin

+ 1 - 1
mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLoginExt.kt

@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.network.protocol.packet.login.wtlogin
 
-import kotlinx.io.core.*
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.LoginExtraData
 import net.mamoe.mirai.internal.network.QQAndroidClient

+ 5 - 6
mirai-core/src/commonMain/kotlin/network/protocol/packet/summarycard/SummaryCard.kt

@@ -1,16 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.protocol.packet.summarycard
 
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.discardExact
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.data.UserProfile
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.network.Packet

+ 4 - 5
mirai-core/src/commonMain/kotlin/utils/PlatformDatagramChannel.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -9,12 +9,11 @@
 
 package net.mamoe.mirai.internal.utils
 
+import io.ktor.utils.io.core.*
+import io.ktor.utils.io.nio.readPacketAtMost
+import io.ktor.utils.io.nio.writePacket
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.withContext
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.Closeable
-import kotlinx.io.nio.readPacketAtMost
-import kotlinx.io.nio.writePacket
 import java.net.InetSocketAddress
 import java.nio.channels.DatagramChannel
 import java.nio.channels.ReadableByteChannel

+ 7 - 10
mirai-core/src/commonMain/kotlin/utils/PlatformSocket.kt

@@ -1,29 +1,26 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.utils
 
+import io.ktor.utils.io.core.*
+import io.ktor.utils.io.streams.readPacketAtMost
+import io.ktor.utils.io.streams.writePacket
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.runInterruptible
 import kotlinx.coroutines.suspendCancellableCoroutine
-import kotlinx.io.core.ByteReadPacket
-import kotlinx.io.core.Closeable
-import kotlinx.io.streams.readPacketAtMost
-import kotlinx.io.streams.writePacket
 import net.mamoe.mirai.internal.network.highway.HighwayProtocolChannel
 import net.mamoe.mirai.utils.withUse
 import java.io.BufferedInputStream
 import java.io.BufferedOutputStream
 import java.io.IOException
-import java.net.NoRouteToHostException
 import java.net.Socket
-import java.net.UnknownHostException
 import java.util.concurrent.Executors
 import kotlin.contracts.InvocationKind
 import kotlin.contracts.contract

+ 2 - 2
mirai-core/src/commonMain/kotlin/utils/crypto/TEA.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.utils.crypto
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.utils.ByteArrayPool
 import net.mamoe.mirai.utils.toByteArray
 import net.mamoe.mirai.utils.toUHexString

+ 3 - 3
mirai-core/src/commonMain/kotlin/utils/io/output.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -13,9 +13,9 @@
 
 package net.mamoe.mirai.internal.utils.io
 
+import io.ktor.utils.io.core.*
 import io.ktor.utils.io.streams.*
-import kotlinx.io.core.*
-import kotlinx.io.streams.outputStream
+import io.ktor.utils.io.streams.outputStream
 import net.mamoe.mirai.internal.utils.coerceAtMostOrFail
 import net.mamoe.mirai.internal.utils.crypto.TEA
 import net.mamoe.mirai.utils.ExternalResource

+ 2 - 3
mirai-core/src/commonMain/kotlin/utils/io/serialization/tars/Tars.kt

@@ -11,9 +11,8 @@
 
 package net.mamoe.mirai.internal.utils.io.serialization.tars
 
-import kotlinx.io.charsets.Charset
-import kotlinx.io.charsets.Charsets
-import kotlinx.io.core.*
+import io.ktor.utils.io.charsets.*
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.*
 import kotlinx.serialization.modules.EmptySerializersModule
 import kotlinx.serialization.modules.SerializersModule

+ 2 - 2
mirai-core/src/commonMain/kotlin/utils/io/serialization/tars/internal/TarsInput.kt

@@ -9,8 +9,8 @@
 
 package net.mamoe.mirai.internal.utils.io.serialization.tars.internal
 
-import kotlinx.io.charsets.Charset
-import kotlinx.io.core.*
+import io.ktor.utils.io.charsets.*
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars
 
 

+ 6 - 7
mirai-core/src/commonMain/kotlin/utils/io/serialization/tars/internal/TarsOld.kt

@@ -1,17 +1,16 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.utils.io.serialization.tars.internal
 
-import kotlinx.io.charsets.Charset
-import kotlinx.io.charsets.Charsets
-import kotlinx.io.core.*
+import io.ktor.utils.io.charsets.*
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.*
 import kotlinx.serialization.builtins.MapEntrySerializer
 import kotlinx.serialization.builtins.SetSerializer

+ 2 - 2
mirai-core/src/commonMain/kotlin/utils/io/serialization/tars/internal/TarsTag.kt

@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
  * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -9,7 +9,7 @@
 
 package net.mamoe.mirai.internal.utils.io.serialization.tars.internal
 
-import kotlinx.io.core.Output
+import io.ktor.utils.io.core.*
 import kotlinx.serialization.ExperimentalSerializationApi
 import kotlinx.serialization.descriptors.SerialDescriptor
 import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars

+ 2 - 2
mirai-core/src/commonMain/kotlin/utils/io/serialization/utils.kt

@@ -13,8 +13,8 @@
 
 package net.mamoe.mirai.internal.utils.io.serialization
 
-import kotlinx.io.core.*
-import kotlinx.io.streams.asInput
+import io.ktor.utils.io.core.*
+import io.ktor.utils.io.streams.asInput
 import kotlinx.serialization.DeserializationStrategy
 import kotlinx.serialization.SerializationStrategy
 import kotlinx.serialization.descriptors.SerialDescriptor

+ 5 - 5
mirai-core/src/commonTest/kotlin/PlatformUtilsTest.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal
 
-import kotlinx.io.core.toByteArray
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.test.AbstractTest
 import net.mamoe.mirai.utils.gzip
 import net.mamoe.mirai.utils.ungzip

+ 1 - 1
mirai-core/src/commonTest/kotlin/message/protocol/impl/AbstractMessageProtocolTest.kt

@@ -9,10 +9,10 @@
 
 package net.mamoe.mirai.internal.message.protocol.impl
 
+import io.ktor.utils.io.core.*
 import kotlinx.coroutines.CompletableDeferred
 import kotlinx.coroutines.Deferred
 import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.io.core.ByteReadPacket
 import net.mamoe.mirai.contact.ContactOrBot
 import net.mamoe.mirai.contact.Friend
 import net.mamoe.mirai.contact.Group

+ 5 - 6
mirai-core/src/commonTest/kotlin/network/framework/AbstractNettyNHTest.kt

@@ -1,21 +1,20 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.framework
 
+import io.ktor.utils.io.core.*
 import io.netty.channel.Channel
 import io.netty.channel.embedded.EmbeddedChannel
 import io.netty.util.ReferenceCountUtil
 import kotlinx.coroutines.CompletableDeferred
 import kotlinx.coroutines.CoroutineScope
-import kotlinx.io.core.buildPacket
-import kotlinx.io.core.readBytes
 import kotlinx.serialization.InternalSerializationApi
 import kotlinx.serialization.KSerializer
 import kotlinx.serialization.serializer

+ 5 - 5
mirai-core/src/commonTest/kotlin/network/impl/netty/NettyResumeConnectionTest.kt

@@ -1,15 +1,15 @@
 /*
- * Copyright 2019-2021 Mamoe Technologies and contributors.
+ * Copyright 2019-2022 Mamoe Technologies and contributors.
  *
- *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
- *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
+ * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
+ * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
- *  https://github.com/mamoe/mirai/blob/master/LICENSE
+ * https://github.com/mamoe/mirai/blob/dev/LICENSE
  */
 
 package net.mamoe.mirai.internal.network.impl.netty
 
-import kotlinx.io.core.ByteReadPacket
+import io.ktor.utils.io.core.*
 import net.mamoe.mirai.internal.network.framework.AbstractNettyNHTest
 import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacket
 import net.mamoe.mirai.internal.test.runBlockingUnit

Vissa filer visades inte eftersom för många filer har ändrats