Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import com.twitter.chill._
object TwitterChillPlayGround extends App {
def serialize[T](t: T): Array[Byte] = ScalaKryoInstantiator.defaultPool.toBytesWithClass(t)
def deserialize[T](bytes: Array[Byte]): T = ScalaKryoInstantiator.defaultPool.fromBytes(bytes).asInstanceOf[T]
def roundTrip[T](t: T): T = deserialize(serialize(t))
require(Map("foo" -> "bar") == roundTrip(Map("foo" -> "bar")))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment