shusek
09/01/2021, 9:43 AM<http://io.ktor.utils.io|io.ktor.utils.io>.core.Input
or <http://io.ktor.utils.io|io.ktor.utils.io>.core.Output
? I can't find a description for them and i am affraid it is internal classes which will be deleted.
My problem is that ByteReadChannel is malformed on receive but io.ktor.utils.i.core.Input
works fine. Can i use Input
class without fear?
val channel: Input = httpResponse.receive() //works fine
val channel: ByteReadChannel = httpResponse.receive() // throw exception MalformedInputException: Input length = 1
Aleksei Tirman [JB]
09/01/2021, 9:51 AMInput
and Output
interfaces are public. In Ktor 2.0.0 they will become abstract classes. I think you can use them without fear. @Rustam Siniukov please confirm.Rustam Siniukov
09/01/2021, 10:30 AMe5l
09/01/2021, 10:33 AMInput
. Could you log an issue about ByteReadChannel
?shusek
09/01/2021, 6:11 PM<http://io.ktor.utils.io|io.ktor.utils.io>.charsets.MalformedInputException: Input length = 1
at <http://io.ktor.utils.io|io.ktor.utils.io>.charsets.CharsetJVMKt.throwExceptionWrapped(CharsetJVM.kt:325)
at <http://io.ktor.utils.io|io.ktor.utils.io>.charsets.CharsetJVMKt.decode(CharsetJVM.kt:199)
at <http://io.ktor.utils.io|io.ktor.utils.io>.charsets.EncodingKt.decode(Encoding.kt:103)
at <http://io.ktor.utils.io|io.ktor.utils.io>.core.StringsKt.readText(Strings.kt:255)
at <http://io.ktor.utils.io|io.ktor.utils.io>.core.StringsKt.readText$default(Strings.kt:254)
at io.ktor.client.features.json.serializer.KotlinxSerializer.read(KotlinxSerializer.kt:34)
at io.ktor.client.features.json.JsonSerializer$DefaultImpls.read(JsonSerializer.kt:31)
at io.ktor.client.features.json.serializer.KotlinxSerializer.read(KotlinxSerializer.kt:20)
at io.ktor.client.features.json.JsonFeature$Feature$install$2.invokeSuspend(JsonFeature.kt:161)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Aleksei Tirman [JB]
09/01/2021, 6:12 PMMalformedInputException
.shusek
09/01/2021, 6:13 PM