Simple, hassle-free, zero-boilerplate serialization in Scala/Java similar to Python's Pickle?

后端 未结 5 1188
无人共我
无人共我 2021-01-30 13:10

Is there a simple, hassle-free approach to serialization in Scala/Java that\'s similar to Python\'s pickle? Pickle is a dead-simple solution that\'s reasonably efficient in spa

5条回答
  •  礼貌的吻别
    2021-01-30 13:54

    I would recommend SBinary. It uses implicits which are resolved at compile time, so it's very effective and typesafe. It comes with built-in support for many common Scala datatypes. You have to manually write the serialization code for your (case) classes, but it's easy to do.

    A usage example for a simple ADT

提交回复
热议问题