'Parse a string indicating a byte quantity into an integer.'

@staticmethod
def parse_bytes(bytestr):

    matchobj = re.match(u'(?i)^(\\d+(?:\\.\\d+)?)([kMGTPEZY]?)$', bytestr)
    if (matchobj is None):
        return None
    number = float(matchobj.group(1))
    multiplier = (1024.0 ** u'bkmgtpezy'.index(matchobj.group(2).lower()))
    return int(round((number * multiplier)))
