kotlinx-io
kotlinx-io copied to clipboard
Question: Implement custom multi-platform InputStream
trafficstars
Hello,
I have asked the question on StackOverflow, but didn't get any response there. So I'll try my luck here.
I’m looking for a multi-platform alternative to input streams. My concrete task is to fetch an encrypted file from a remote server via https and decrypt it on demand.
In Java land I would an implement InputStream which proxies the reads to the input stream from the https library. How can I do the same in kotlin targeting multiple platforms.
I see ktor returns an ByteReadChannel, but I don’t know which functions.
I’m lost and don’t know where to start. Thanks for your help in advance.