'Reads the VBRI header or raises VBRIHeaderError.
The file position is undefined after this returns'

def __init__(self, fileobj):

    data = fileobj.read(26)
    if ((len(data) != 26) or (not data.startswith('VBRI'))):
        raise VBRIHeaderError('Not    a    VBRI    header')
    offset = 4
    (self.version, offset) = cdata.uint16_be_from(data, offset)
    if (self.version != 1):
        raise VBRIHeaderError(('Unsupported    header    version:    %r' % self.version))
    offset += 2
    (self.quality, offset) = cdata.uint16_be_from(data, offset)
    (self.bytes, offset) = cdata.uint32_be_from(data, offset)
    (self.frames, offset) = cdata.uint32_be_from(data, offset)
    (toc_num_entries, offset) = cdata.uint16_be_from(data, offset)
    (self.toc_scale_factor, offset) = cdata.uint16_be_from(data, offset)
    (toc_entry_size, offset) = cdata.uint16_be_from(data, offset)
    (self.toc_frames, offset) = cdata.uint16_be_from(data, offset)
    toc_size = (toc_entry_size * toc_num_entries)
    toc_data = fileobj.read(toc_size)
    if (len(toc_data) != toc_size):
        raise VBRIHeaderError('VBRI    header    truncated')
    self.toc = []
    if (toc_entry_size == 2):
        unpack = partial(cdata.uint16_be_from, toc_data)
    elif (toc_entry_size == 4):
        unpack = partial(cdata.uint32_be_from, toc_data)
    else:
        raise VBRIHeaderError('Invalid    TOC    entry    size')
    self.toc = [unpack(i)[0] for i in xrange(0, toc_size, toc_entry_size)]
