sms-translate/app
Tom Levy a7edeae6f3 Use streams to encode and decode the JSON backups
This significantly reduces memory usage.

(We buffer the OutputStream because kotlinx.serialization flushes its
internal buffers excessively[1]. We also buffer the InputStream for
consistency, even though kotlinx.serialization uses adequate
buffering; there is no performance impact because BufferedInputStream
cascades harmlessly[2].)

The functions encodeToStream() and decodeFromStream() are marked as
experimental, but this is a pretty fundamental use case so surely it
will continue to be supported in the future (maybe with minor
changes).

Fixes #6.

[1] https://github.com/Kotlin/kotlinx.serialization/blob/v1.6.3/formats/json/jvmMain/src/kotlinx/serialization/json/internal/JvmJsonStreams.kt#L46
[2] https://github.com/openjdk/jdk/blob/jdk-23%2B14/src/java.base/share/classes/java/io/BufferedInputStream.java#L339
2024-05-20 01:43:25 +00:00
..
src Use streams to encode and decode the JSON backups 2024-05-20 01:43:25 +00:00
.gitignore Update .gitignore 2024-01-23 00:08:18 +05:30
build.gradle.kts Exclude dependency info from APKs 2024-01-22 19:33:59 +05:30
proguard-rules.pro Rename package to org.fossify.messages 2024-01-18 01:05:03 +05:30