Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WriteCentralDirectoryFileHeader()

void System.IO.Compression.ZipArchiveEntry.WriteCentralDirectoryFileHeader ( )
inlinepackage

Definition at line 565 of file ZipArchiveEntry.cs.

566 {
567 BinaryWriter binaryWriter = new BinaryWriter(_archive.ArchiveStream);
568 Zip64ExtraField zip64ExtraField = default(Zip64ExtraField);
569 bool flag = false;
570 uint value;
571 uint value2;
572 if (SizesTooLarge())
573 {
574 flag = true;
575 value = uint.MaxValue;
576 value2 = uint.MaxValue;
577 zip64ExtraField.CompressedSize = _compressedSize;
578 zip64ExtraField.UncompressedSize = _uncompressedSize;
579 }
580 else
581 {
582 value = (uint)_compressedSize;
584 }
585 uint value3;
586 if (_offsetOfLocalHeader > uint.MaxValue)
587 {
588 flag = true;
589 value3 = uint.MaxValue;
590 zip64ExtraField.LocalHeaderOffset = _offsetOfLocalHeader;
591 }
592 else
593 {
595 }
596 if (flag)
597 {
598 VersionToExtractAtLeast(ZipVersionNeededValues.Zip64);
599 }
600 int num = (flag ? zip64ExtraField.TotalSize : 0) + ((_cdUnknownExtraFields != null) ? ZipGenericExtraField.TotalSize(_cdUnknownExtraFields) : 0);
601 ushort value4;
602 if (num > 65535)
603 {
604 value4 = (ushort)(flag ? zip64ExtraField.TotalSize : 0);
606 }
607 else
608 {
609 value4 = (ushort)num;
610 }
611 binaryWriter.Write(33639248u);
613 binaryWriter.Write((byte)0);
614 binaryWriter.Write((ushort)_versionToExtract);
616 binaryWriter.Write((ushort)CompressionMethod);
617 binaryWriter.Write(ZipHelper.DateTimeToDosTime(_lastModified.DateTime));
618 binaryWriter.Write(_crc32);
619 binaryWriter.Write(value);
620 binaryWriter.Write(value2);
621 binaryWriter.Write((ushort)_storedEntryNameBytes.Length);
622 binaryWriter.Write(value4);
623 binaryWriter.Write((ushort)((_fileComment != null) ? ((ushort)_fileComment.Length) : 0));
624 binaryWriter.Write((ushort)0);
625 binaryWriter.Write((ushort)0);
627 binaryWriter.Write(value3);
629 if (flag)
630 {
632 }
633 if (_cdUnknownExtraFields != null)
634 {
635 ZipGenericExtraField.WriteAllBlocks(_cdUnknownExtraFields, _archive.ArchiveStream);
636 }
637 if (_fileComment != null)
638 {
640 }
641 }
void VersionToExtractAtLeast(ZipVersionNeededValues value)
List< ZipGenericExtraField > _cdUnknownExtraFields
ZipVersionNeededValues _versionMadeBySpecification
CompressionMethodValues CompressionMethod

References System.IO.Compression.ZipArchiveEntry._archive, System.IO.Compression.ZipArchiveEntry._cdUnknownExtraFields, System.IO.Compression.ZipArchiveEntry._compressedSize, System.IO.Compression.ZipArchiveEntry._crc32, System.IO.Compression.ZipArchiveEntry._externalFileAttr, System.IO.Compression.ZipArchiveEntry._fileComment, System.IO.Compression.ZipArchiveEntry._generalPurposeBitFlag, System.IO.Compression.ZipArchiveEntry._lastModified, System.IO.Compression.ZipArchiveEntry._offsetOfLocalHeader, System.IO.Compression.ZipArchiveEntry._storedEntryNameBytes, System.IO.Compression.ZipArchiveEntry._uncompressedSize, System.IO.Compression.ZipArchiveEntry._versionMadeBySpecification, System.IO.Compression.ZipArchiveEntry._versionToExtract, System.IO.Compression.ZipArchive.ArchiveStream, System.IO.Compression.ZipArchiveEntry.CompressionMethod, System.DateTimeOffset.DateTime, System.IO.Compression.ZipHelper.DateTimeToDosTime(), System.IO.Compression.ZipArchiveEntry.SizesTooLarge(), System.IO.Compression.ZipGenericExtraField.TotalSize(), System.value, System.IO.Compression.ZipArchiveEntry.VersionToExtractAtLeast(), and System.IO.Compression.ZipGenericExtraField.WriteAllBlocks().