

def write(self, out, obj):
    the_big_int = (((- obj) - 1) if (obj < 0) else obj)
    end_index = ((- 1) if (type(obj) == long) else None)
    hex_str = hex(the_big_int)[2:end_index]
    if ((len(hex_str) % 2) == 1):
        prefix = '0'
        hex_str = (prefix + hex_str)
    num_array = bytearray(binascii.unhexlify(bytearray(hex_str)))
    if (obj < 0):
        neg = bytearray()
        for c in num_array:
            neg.append((c ^ 255))
        num_array = neg
    out.write_byte_array(num_array)

dataset/ETHPy150Open hazelcast/hazelcast-python-client/hazelcast/serialization/serializer.py BigIntegerSerializer.write/original