These codes serialize and deserialize an object