fun <T : Any> T.serialize(kryo: <ERROR CLASS> = THREAD_LOCAL_KRYO.get()): SerializedBytes<T>
Can be called on any object to convert it to a byte array (wrapped by SerializedBytes), regardless of whether the type is marked as serializable or was designed for it (so be careful).