'Writes a file header.'

def WriteFileHeader(self, arcname=None, compress_type=None, st=None):

    if (not self._stream):
        raise ArchiveAlreadyClosedError('Attempting    to    write    to    a    ZIP    archive    that    was    already    closed.')
    self.cur_zinfo = self._GenerateZipInfo(arcname=arcname, compress_type=compress_type, st=st)
    self.cur_file_size = 0
    self.cur_compress_size = 0
    if (self.cur_zinfo.compress_type == zipfile.ZIP_DEFLATED):
        self.cur_cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, (-15))
    else:
        self.cur_cmpr = None
    self.cur_crc = 0
    if (not self._stream):
        raise ArchiveAlreadyClosedError('Attempting    to    write    to    a    ZIP    archive    that    was    already    closed.')
    self.cur_zinfo.header_offset = self._stream.tell()
    self._zip_fd._writecheck(self.cur_zinfo)
    self._zip_fd._didModify = True
    self._stream.write(self.cur_zinfo.FileHeader())
    return self._stream.GetValueAndReset()
