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

◆ WriteCrcAndSizesInLocalHeader()

void System.IO.Compression.ZipArchiveEntry.WriteCrcAndSizesInLocalHeader ( bool zip64HeaderUsed)
inlineprivate

Definition at line 920 of file ZipArchiveEntry.cs.

921 {
922 long position = _archive.ArchiveStream.Position;
923 BinaryWriter binaryWriter = new BinaryWriter(_archive.ArchiveStream);
924 bool flag = SizesTooLarge();
925 bool flag2 = flag && !zip64HeaderUsed;
926 uint value = (uint)(flag ? uint.MaxValue : _compressedSize);
927 uint value2 = (uint)(flag ? uint.MaxValue : _uncompressedSize);
928 if (flag2)
929 {
930 VersionToExtractAtLeast(ZipVersionNeededValues.Zip64);
931 _generalPurposeBitFlag |= BitFlagValues.DataDescriptor;
933 binaryWriter.Write((ushort)_versionToExtract);
935 }
937 if (!flag2)
938 {
939 binaryWriter.Write(_crc32);
940 binaryWriter.Write(value);
941 binaryWriter.Write(value2);
942 }
943 else
944 {
945 binaryWriter.Write(0u);
946 binaryWriter.Write(0u);
947 binaryWriter.Write(0u);
948 }
949 if (zip64HeaderUsed)
950 {
954 }
955 _archive.ArchiveStream.Seek(position, SeekOrigin.Begin);
956 if (flag2)
957 {
958 binaryWriter.Write(_crc32);
961 }
962 }
void VersionToExtractAtLeast(ZipVersionNeededValues value)
long Seek(long offset, SeekOrigin origin)

References System.IO.Compression.ZipArchiveEntry._archive, System.IO.Compression.ZipArchiveEntry._compressedSize, System.IO.Compression.ZipArchiveEntry._crc32, System.IO.Compression.ZipArchiveEntry._generalPurposeBitFlag, System.IO.Compression.ZipArchiveEntry._offsetOfLocalHeader, System.IO.Compression.ZipArchiveEntry._storedEntryNameBytes, System.IO.Compression.ZipArchiveEntry._uncompressedSize, System.IO.Compression.ZipArchiveEntry._versionToExtract, System.IO.Compression.ZipArchive.ArchiveStream, System.IO.Stream.Position, System.IO.Stream.Seek(), System.IO.Compression.ZipArchiveEntry.SizesTooLarge(), System.value, and System.IO.Compression.ZipArchiveEntry.VersionToExtractAtLeast().

Referenced by System.IO.Compression.ZipArchiveEntry.DirectToArchiveWriterStream.Dispose().