Serialize
The polorize()
operator is used to serialize and object or primitive to a bytes value. This operator performs polo serialization on the object passed to it.
Read more about polo encoding here:
Deserialize
The depolorize()
call performs deserialization on the polo encoded object returning the object type as provided to the operator call.
s = depolorize(String, b)
In this s is set with a depolorized String
value obtained from the bytes ‘b’.
coco Serialization
class Person:
field name String
endpoint invokable Polorize(s String) -> (b Bytes):
b = polorize(s)
endpoint invokable Depolorize(b Bytes) -> (s String):
s = depolorize(String, b)