Offline serialization and deserialization