def METHOD_NAME(cls, value):
    # if negative, it's actually a very large unsigned long value
    if value < 0:
        # 1 marker + 8 data bytes
        return 9
    if value < 253:
        # 1 data byte
        return 1
    if value <= 0xFFFF:
        # 1 marker + 2 data bytes
        return 3
    if value <= 0xFFFFFFFF:
        # 1 marker + 4 data bytes
        return 5
    # 1 marker + 8 data bytes
    return 9