'Raises ID3NoHeaderError, ID3UnsupportedVersionError or error'

@convert_error(IOError, error)
def __init__(self, fileobj=None):

    if (fileobj is None):
        self._flags = 0
        return
    fn = getattr(fileobj, 'name', '<unknown>')
    data = fileobj.read(10)
    if (len(data) != 10):
        raise ID3NoHeaderError(('%s:    too    small' % fn))
    (id3, vmaj, vrev, flags, size) = struct.unpack('>3sBBB4s', data)
    self._flags = flags
    self.size = (BitPaddedInt(size) + 10)
    self.version = (2, vmaj, vrev)
    if (id3 != 'ID3'):
        raise ID3NoHeaderError(("%r    doesn't    start    with    an    ID3    tag" % fn))
    if (vmaj not in [2, 3, 4]):
        raise ID3UnsupportedVersionError(('%r    ID3v2.%d    not    supported' % (fn, vmaj)))
    if (not BitPaddedInt.has_valid_padding(size)):
        raise error('Header    size    not    synchsafe')
    if ((self.version >= self._V24) and (flags & 15)):
        raise error(('%r    has    invalid    flags    %#02x' % (fn, flags)))
    elif ((self._V23 <= self.version < self._V24) and (flags & 31)):
        raise error(('%r    has    invalid    flags    %#02x' % (fn, flags)))
    if self.f_extended:
        extsize_data = read_full(fileobj, 4)
        if PY3:
            frame_id = extsize_data.decode('ascii', 'replace')
        else:
            frame_id = extsize_data
        if (frame_id in Frames):
            self._flags ^= 64
            extsize = 0
            fileobj.seek((-4), 1)
        elif (self.version >= self._V24):
            extsize = (BitPaddedInt(extsize_data) - 4)
            if (not BitPaddedInt.has_valid_padding(extsize_data)):
                raise error('Extended    header    size    not    synchsafe')
        else:
            extsize = struct.unpack('>L', extsize_data)[0]
        self._extdata = read_full(fileobj, extsize)
