'Parses the Xing header or raises XingHeaderError.
The file position after this returns is undefined.'

def __init__(self, fileobj):

    data = fileobj.read(8)
    if ((len(data) != 8) or (data[:4] not in ('Xing', 'Info'))):
        raise XingHeaderError('Not    a    Xing    header')
    self.is_info = (data[:4] == 'Info')
    flags = cdata.uint32_be_from(data, 4)[0]
    if (flags & XingHeaderFlags.FRAMES):
        data = fileobj.read(4)
        if (len(data) != 4):
            raise XingHeaderError('Xing    header    truncated')
        self.frames = cdata.uint32_be(data)
    if (flags & XingHeaderFlags.BYTES):
        data = fileobj.read(4)
        if (len(data) != 4):
            raise XingHeaderError('Xing    header    truncated')
        self.bytes = cdata.uint32_be(data)
    if (flags & XingHeaderFlags.TOC):
        data = fileobj.read(100)
        if (len(data) != 100):
            raise XingHeaderError('Xing    header    truncated')
        self.toc = list(bytearray(data))
    if (flags & XingHeaderFlags.VBR_SCALE):
        data = fileobj.read(4)
        if (len(data) != 4):
            raise XingHeaderError('Xing    header    truncated')
        self.vbr_scale = cdata.uint32_be(data)
    try:
        (self.lame_version, self.lame_version_desc, has_header) = LAMEHeader.parse_version(fileobj)
        if has_header:
            self.lame_header = LAMEHeader(self, fileobj)
    except LAMEError:
        pass
