'Parse the header and write the values into self.header. Also sets
self.header_length.'

def _read_header(self, stream):

    stream.seek(12)
    while True:
        field_id = stream_unpack(stream, None, 1, 'b')
        if (not (field_id in self.header.fields.values())):
            raise IOError('Unknown    header    field    found.')
        length = stream_unpack(stream, None, 2, 'h')
        if (length > 0):
            data = stream_unpack(stream, None, length, '{}s'.format(length))
            self.header.b[field_id] = data
        if (field_id == 0):
            self.header_length = stream.tell()
            break
