Android, Jetpack, Jetpack Datastore.
InputStream): UserPreferences { return UserPreferences.parseFrom(inputStream) } override fun writeTo(outputStream: OutputStream, value: UserPreferences) { value.writeTo(outputStream) } } Explanation: We define a .proto file for UserPreferences and generate corresponding classes using the protoc