ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteZip64EndOfCentralDirectory C# (CSharp) Method

WriteZip64EndOfCentralDirectory() public method

Write Zip64 end of central directory records (File header and locator).
public WriteZip64EndOfCentralDirectory ( long noOfEntries, long sizeEntries, long centralDirOffset ) : void
noOfEntries long The number of entries in the central directory.
sizeEntries long The size of entries in the central directory.
centralDirOffset long The offset of the dentral directory.
return void
        public void WriteZip64EndOfCentralDirectory(long noOfEntries, long sizeEntries, long centralDirOffset)
        {
            long centralSignatureOffset = stream_.Position;
            WriteLEInt(ZipConstants.Zip64CentralFileHeaderSignature);
            WriteLELong(44);    // Size of this record (total size of remaining fields in header or full size - 12)
            WriteLEShort(ZipConstants.VersionMadeBy);   // Version made by
            WriteLEShort(ZipConstants.VersionZip64);   // Version to extract
            WriteLEInt(0);      // Number of this disk
            WriteLEInt(0);      // number of the disk with the start of the central directory
            WriteLELong(noOfEntries);       // No of entries on this disk
            WriteLELong(noOfEntries);       // Total No of entries in central directory
            WriteLELong(sizeEntries);       // Size of the central directory
            WriteLELong(centralDirOffset);  // offset of start of central directory
                                            // zip64 extensible data sector not catered for here (variable size)

            // Write the Zip64 end of central directory locator
            WriteLEInt(ZipConstants.Zip64CentralDirLocatorSignature);

            // no of the disk with the start of the zip64 end of central directory
            WriteLEInt(0);

            // relative offset of the zip64 end of central directory record
            WriteLELong(centralSignatureOffset);

            // total number of disks
            WriteLEInt(1);
        }