def METHOD_NAME(self, pkt, pay):
    length = self.len
    if length is None:
        if SOMEIP._is_tp(self):
            length = SOMEIP.LEN_OFFSET_TP + len(pay)
        else:
            length = SOMEIP.LEN_OFFSET + len(pay)
        pkt = pkt[:4] + struct.pack("!I", length) + pkt[8:]
    return pkt + pay