(self, obj)
Returns the number of bytes necessary to store the given integer.
Returns the number of bytes necessary to store the given integer.
Returns the number of bytes necessary to store the given integer .
def intSize(self, obj):
        """Returns the number of bytes necessary to store the given integer."""
        # SIGNED
        if obj < 0: # Signed integer, always 8 bytes
            return 8
        # UNSIGNED
        elif obj <= 0xFF: # 1 byte
            return 1
        elif obj <= 0xFFFF: # 2 bytes
            return 2
        elif obj <= 0xFFFFFFFF: # 4 bytes
            return 4
        # SIGNED
        # 0x7FFFFFFFFFFFFFFF is the max.
        elif obj <= 0x7FFFFFFFFFFFFFFF: # 8 bytes
            return 8
        else:
            raise InvalidPlistException("Core Foundation can't handle integers with size greater than 8 bytes.")
def intSize ( self , obj ) : # SIGNED if obj < 0 : # Signed integer, always 8 bytes return 8 # UNSIGNED elif obj <= 0xFF : # 1 byte return 1 elif obj <= 0xFFFF : # 2 bytes return 2 elif obj <= 0xFFFFFFFF : # 4 bytes return 4 # SIGNED # 0x7FFFFFFFFFFFFFFF is the max. elif obj <= 0x7FFFFFFFFFFFFFFF : # 8 bytes return 8 else : raise InvalidPlistException ( "Core Foundation can't handle integers with size greater than 8 bytes." )