def _serialize(self, packet):
        size = self.payload.size

        if size > 0xFFFFFFFF or self.extended_size:
            packet += U32BE(1)
        else:
            packet += U32BE(size + 8)

        packet += FourCC(self.type)

        if 0xFFFFFFFF > size or self.extended_size:
            packet += U64BE(size + 16)

        if isinstance(self.payload, BoxPayload):
            self.payload.serialize(packet)
        else:
            packetwrite(self.payload)
dataset/ETHPy150Open chrippa/livestreamer/src/livestreamer/packages/flashmedia/box.py/Box._serialize/swapped operands of `>`