Use kotlinx.io

This commit is contained in:
Him188 2020-03-08 00:49:24 +08:00
parent ef29345d71
commit 0a64654a4f
5 changed files with 12 additions and 10 deletions

View File

@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.io.serialization
import io.ktor.utils.io.core.Input
import io.ktor.utils.io.core.Output
import kotlinx.io.core.Input
import kotlinx.io.core.Output
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialFormat
import kotlinx.serialization.SerializationStrategy

View File

@ -9,7 +9,7 @@
package net.mamoe.mirai.qqandroid.io.serialization.jce
import io.ktor.utils.io.core.*
import kotlinx.io.core.*
import net.mamoe.mirai.qqandroid.io.serialization.Jce
import net.mamoe.mirai.qqandroid.io.serialization.JceCharset
import net.mamoe.mirai.utils.io.readString

View File

@ -9,8 +9,8 @@
package net.mamoe.mirai.qqandroid.io.serialization.jce
import io.ktor.utils.io.core.Input
import io.ktor.utils.io.core.Output
import kotlinx.io.core.Input
import kotlinx.io.core.Output
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialFormat
import kotlinx.serialization.SerializationStrategy

View File

@ -9,7 +9,7 @@
package net.mamoe.mirai.qqandroid.io.serialization.jce
import io.ktor.utils.io.core.Output
import kotlinx.io.core.Output
import kotlinx.serialization.SerialInfo
import net.mamoe.mirai.qqandroid.io.serialization.Jce

View File

@ -2,7 +2,9 @@
package net.mamoe.mirai.qqandroid.io.serialization
import io.ktor.utils.io.core.*
import kotlinx.io.core.EOFException
import kotlinx.io.core.buildPacket
import kotlinx.io.core.writeFully
import kotlinx.serialization.MissingFieldException
import kotlinx.serialization.Serializable
import net.mamoe.mirai.qqandroid.io.serialization.jce.JceId
@ -63,13 +65,13 @@ internal class JceInputTest {
writeJceHead(BYTE, 0)
writeByte(2)
listOf(listOf(1, 2, 3, 4), listOf(1, 2, 3, 4)).forEach {
listOf(listOf(1, 2, 3, 4), listOf(1, 2, 3, 4)).forEach { child ->
writeJceHead(LIST, 0)
writeJceHead(BYTE, 0)
writeByte(it.size.toByte())
writeByte(child.size.toByte())
it.forEach {
child.forEach {
writeJceHead(INT, 0)
writeInt(it)
}