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

◆ GetDataCompressor()

CheckSumAndSizeWriteStream System.IO.Compression.ZipArchiveEntry.GetDataCompressor ( Stream backingStream,
bool leaveBackingStreamOpen,
EventHandler onClose )
inlineprivate

Definition at line 677 of file ZipArchiveEntry.cs.

678 {
679 bool flag = true;
681 switch (CompressionMethod)
682 {
683 case CompressionMethodValues.Stored:
685 flag = false;
686 break;
687 default:
688 baseStream = new DeflateStream(backingStream, _compressionLevel.GetValueOrDefault(), leaveBackingStreamOpen);
689 break;
690 }
692 return new CheckSumAndSizeWriteStream(baseStream, backingStream, leaveOpenOnClose, this, onClose, delegate(long initialPosition, long currentPosition, uint checkSum, Stream backing, ZipArchiveEntry thisRef, EventHandler closeHandler)
693 {
694 thisRef._crc32 = checkSum;
695 thisRef._uncompressedSize = currentPosition;
696 thisRef._compressedSize = backing.Position - initialPosition;
697 closeHandler?.Invoke(thisRef, EventArgs.Empty);
698 });
699 }
readonly? CompressionLevel _compressionLevel
ZipArchiveEntry(ZipArchive archive, ZipCentralDirectoryFileHeader cd)
CompressionMethodValues CompressionMethod

References System.IO.Compression.ZipArchiveEntry._compressionLevel, System.IO.Compression.ZipArchiveEntry.CompressionMethod, and System.EventArgs.Empty.

Referenced by System.IO.Compression.ZipArchiveEntry.OpenInWriteMode(), and System.IO.Compression.ZipArchiveEntry.WriteLocalFileHeaderAndDataIfNeeded().