public override void Save(Stream outStream)
{
if (outStream == null || !outStream.CanWrite)
{
throw new ArgumentNullException("outStream");
}
//ODF 格式约定 mimetype 必须为第一个文件
if (!this.entries.ContainsKey(MimeTypeEntryPath))
{
throw new InvalidDataException("Entry 'mimetype' not found");
}
using (var ze = new ZipFile())
{
this.AppendZipEntry(ze, MimeTypeEntryPath);
foreach (var item in this.entries)
{
if (item.Key == MimeTypeEntryPath)
{
continue;
}
this.AppendZipEntry(ze, item.Key);
}
ze.Save(outStream);
}
}