Serialization for Scala.