kotlinx.serialization
kotlinx.serialization copied to clipboard
Consider to implement ReaderJsonLexer::peekLeadingMatchingValue?
What is your use-case and why do you need this feature? Polymorphic deserialization on stream also expects a well performance.
Describe the solution you'd like
Would using InputStream#mark and InputStream#reset to implement this method be a good solution?
https://github.com/Kotlin/kotlinx.serialization/blob/d0ae697b9394103879e6c7f836d0f7cf128f4b1e/formats/json/commonMain/src/kotlinx/serialization/json/internal/lexer/ReaderJsonLexer.kt#L178-L180