Kotlin data class serializable
![Kotlin data class serializable](https://cdn3.cdnme.se/5447227/9-3/screenshot_6_64e62947e087c31b3e7101ab.jpg)
![kotlin data class serializable kotlin data class serializable](https://i.ytimg.com/vi/qrSzw4ok7Dc/maxresdefault.jpg)
But, DataStore also allows you to customize this and use data classes and Kotlin serialization, giving you the type safety advantage of Proto DataStore, but without having to use protobufs.
![kotlin data class serializable kotlin data class serializable](https://plugins.jetbrains.com/files/9960/screenshot_18030.png)
Under the hood, both implementations save data on disk, in a file, using protocol buffers. In our previous posts, we’ve covered how Preferences and Proto DataStore approach structuring and serializing your persisted data: Proto uses typed objects backed by Protocol Buffers, while Preferences uses key-value pairs as our data representation, similarly to SharedPreferences. We will be referring to the Preferences and Proto codelabs throughout this post, for code samples. In this post, we will be focusing on Kotlin serialization. In the following posts from our Jetpack DataStore series, we will cover several additional concepts to understand how DataStore interacts with other APIs, so that you’d have everything at your disposal to use it in a production environment.
![Kotlin data class serializable](https://cdn3.cdnme.se/5447227/9-3/screenshot_6_64e62947e087c31b3e7101ab.jpg)