@classmethod
    def size(cls, val, cache):
        data = String.pack(val, "utf8", "ignore")
        size = len(data)

        if size == 0:
            return U8.size
        elif val in cache:
            index = cache.index(val)
            return AMF3Integer.size(index << 1)
        else:
            cache.append(val)
            return AMF3Integer.size(size << 1 | 1) + size
dataset/ETHPy150Open chrippa/livestreamer/src/livestreamer/packages/flashmedia/types.py/AMF3String.size/original