def serialize(self, obj):
            data = ubjson.dumpb(obj)
            if self._batched:
                return struct.pack("!L", len(data)) + data
            else:
                return data
Implements :func:`autobahn.wamp.interfaces.IObjectSerializer.serialize`
dataset/ETHPy150Open crossbario/autobahn-python/autobahn/wamp/serializer.py/UBJSONObjectSerializer.serialize