Binary Serialisation and deserialisation