'section_lengths = Lenght of each section in file.'

def build_header(self, section_lengths, out_stream):

    now = int(time.time())
    nrecords = len(section_lengths)
    out_stream.write((self.title + struct.pack('>HHIIIIII', 0, 0, now, now, 0, 0, 0, 0)))
    out_stream.write((self.identity + struct.pack('>IIH', nrecords, 0, nrecords)))
    offset = ((78 + (8 * nrecords)) + 2)
    for (id, record) in enumerate(section_lengths):
        out_stream.write(struct.pack('>LBBBB', long(offset), 0, 0, 0, 0))
        offset += record
    out_stream.write('\x00\x00')
