Finish()
{
if (this.entries != null)
{
if (this.curEntry != null)
{
this.CloseEntry();
}
long count = this.entries.Count;
long sizeEntries = 0L;
foreach (ZipEntry entry in this.entries)
{
this.WriteLeInt(0x2014b50);
this.WriteLeShort(0x33);
this.WriteLeShort(entry.Version);
this.WriteLeShort(entry.Flags);
this.WriteLeShort((short) entry.CompressionMethodForHeader);
this.WriteLeInt((int) entry.DosTime);
this.WriteLeInt((int) entry.Crc);
if (entry.IsZip64Forced() || (entry.CompressedSize >= 0xffffffffL))
{
this.WriteLeInt(-1);
}
else
{
this.WriteLeInt((int) entry.CompressedSize);
}
if (entry.IsZip64Forced() || (entry.Size >= 0xffffffffL))
{
this.WriteLeInt(-1);
}
else
{
this.WriteLeInt((int) entry.Size);
}
byte[] buffer = ZipConstants.ConvertToArray(entry.Flags, entry.Name);
if (buffer.Length > 0xffff)
{
);
}
ZipExtraData extraData = new ZipExtraData(entry.ExtraData);
if (entry.CentralHeaderRequiresZip64)
{
extraData.StartNewEntry();
if (entry.IsZip64Forced() || (entry.Size >= 0xffffffffL))
{
extraData.AddLeLong(entry.Size);
}
if (entry.IsZip64Forced() || (entry.CompressedSize >= 0xffffffffL))
{
extraData.AddLeLong(entry.CompressedSize);
}
if (entry.Offset >= 0xffffffffL)
{
extraData.AddLeLong(entry.Offset);
}
extraData.AddNewEntry(1);
}
else
{
extraData.Delete(1);
}
if (entry.AESKeySize > 0)
{
AddExtraDataAES(entry, extraData);
}
byte[] entryData = extraData.GetEntryData();
byte[] buffer3 = (entry.Comment != null) ? ZipConstants.ConvertToArray(entry.Flags, entry.Comment) : new byte[0];
if (buffer3.Length > 0xffff)
{
);
}
this.WriteLeShort(buffer.Length);
this.WriteLeShort(entryData.Length);
this.WriteLeShort(buffer3.Length);
this.WriteLeShort(0);
this.WriteLeShort(0);
if (entry.ExternalFileAttributes != -1)
{
this.WriteLeInt(entry.ExternalFileAttributes);
}
else if (entry.IsDirectory)
{
this.WriteLeInt(0x10);
}
else
{
this.WriteLeInt(0);
}
if (entry.Offset >= 0xffffffffL)
{
this.WriteLeInt(-1);
}
else
{
this.WriteLeInt((int) entry.Offset);
}
if (buffer.Length > 0)
{
base.baseOutputStream_.Write(buffer, 0, buffer.Length);
}
if (entryData.Length > 0)
{
base.baseOutputStream_.Write(entryData, 0, entryData.Length);
}
if (buffer3.Length > 0)
{
base.baseOutputStream_.Write(buffer3, 0, buffer3.Length);
}
sizeEntries += ((0x2e + buffer.Length) + entryData.Length) + buffer3.Length;
}
using (ZipHelperStream stream = new ZipHelperStream(base.baseOutputStream_))
{
stream.WriteEndOfCentralDirectory(count, sizeEntries, this.offset, this.zipComment);
}
this.entries = null;
}
}