340 if (
value.DateTime.Year < 1980 ||
value.DateTime.Year > 2107)
532 return _archive.Mode
switch
575 value = uint.MaxValue;
654 for (
int i = 0; i < _compressedBytes.Length - 1; i++)
660 for (
int j = 0;
j < _compressedBytes.Length - 1;
j++)
692 return new CheckSumAndSizeWriteStream(
baseStream,
backingStream,
leaveOpenOnClose,
this,
onClose,
delegate(
long initialPosition,
long currentPosition, uint
checkSum,
Stream backing,
ZipArchiveEntry thisRef, EventHandler
closeHandler)
733 zipArchiveEntry._outstandingWriteStream =
null;
751 thisRef._currentlyOpenForWrite =
false;
838 value = uint.MaxValue;
1027 if (c ==
'\\' || c ==
'/' || c ==
':')
1029 return path.Substring(num + 1);
1041 if (
path[num] ==
'/')
1043 return path.Substring(num + 1);
static readonly EventArgs Empty
override void Write(byte[] buffer, int offset, int count)
override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override Task FlushAsync(CancellationToken cancellationToken)
override void Dispose(bool disposing)
override int Read(byte[] buffer, int offset, int count)
override void Write(ReadOnlySpan< byte > source)
override ValueTask WriteAsync(ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
override long Seek(long offset, SeekOrigin origin)
override void Write(byte[] buffer, int offset, int count)
override void WriteByte(byte value)
DirectToArchiveWriterStream(CheckSumAndSizeWriteStream crcSizeStream, ZipArchiveEntry entry)
override void Dispose(bool disposing)
readonly ZipArchiveEntry _entry
readonly CheckSumAndSizeWriteStream _crcSizeStream
override Task FlushAsync(CancellationToken cancellationToken)
override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override void SetLength(long value)
void WriteCrcAndSizesInLocalHeader(bool zip64HeaderUsed)
readonly? CompressionLevel _compressionLevel
void VersionToExtractAtLeast(ZipVersionNeededValues value)
CompressionMethodValues _storedCompressionMethod
ZipArchiveEntry(ZipArchive archive, ZipCentralDirectoryFileHeader cd)
static string GetFileName_Windows(string path)
ZipArchiveEntry(ZipArchive archive, string entryName)
bool LoadLocalHeaderExtraFieldAndCompressedBytesIfNeeded()
Stream OpenInUpdateMode()
readonly byte[] _fileComment
Stream _outstandingWriteStream
MemoryStream UncompressedData
readonly bool _originallyInArchive
long? _storedOffsetOfCompressedData
void WriteAndFinishLocalEntry()
void WriteLocalFileHeaderAndDataIfNeeded()
byte[][] _compressedBytes
DateTimeOffset LastWriteTime
void WriteDataDescriptor()
List< ZipGenericExtraField > _cdUnknownExtraFields
ZipArchiveEntry(ZipArchive archive, string entryName, CompressionLevel compressionLevel)
void ThrowIfNotOpenable(bool needToUncompress, bool needToLoadIntoMemory)
BitFlagValues _generalPurposeBitFlag
DateTimeOffset _lastModified
ZipVersionNeededValues _versionToExtract
List< ZipGenericExtraField > _lhUnknownExtraFields
Stream GetDataDecompressor(Stream compressedStreamToRead)
readonly ZipVersionMadeByPlatform _versionMadeByPlatform
CheckSumAndSizeWriteStream GetDataCompressor(Stream backingStream, bool leaveBackingStreamOpen, EventHandler onClose)
string DecodeEntryName(byte[] entryNameBytes)
byte[] _storedEntryNameBytes
void ThrowIfInvalidArchive()
long OffsetOfCompressedData
ZipVersionNeededValues _versionMadeBySpecification
CompressionMethodValues CompressionMethod
bool WriteLocalFileHeader(bool isEmptyFile)
readonly int _diskNumberStart
void WriteCentralDirectoryFileHeader()
bool IsOpenable(bool needToUncompress, bool needToLoadIntoMemory, out string message)
static string ParseFileName(string path, ZipVersionMadeByPlatform madeByPlatform)
static string GetFileName_Unix(string path)
static readonly bool s_allowLargeZipArchiveEntriesInUpdateMode
override string ToString()
Stream OpenInReadMode(bool checkOpenable)
MemoryStream _storedUncompressedData
long _offsetOfLocalHeader
byte[] EncodeEntryName(string entryName, out bool isUTF8)
bool _currentlyOpenForWrite
void AcquireArchiveStream(ZipArchiveEntry entry)
BinaryReader? ArchiveReader
Encoding? EntryNameEncoding
void RemoveEntry(ZipArchiveEntry entry)
static bool RequiresUnicode(string test)
static void ReadBytes(Stream stream, byte[] buffer, int bytesToRead)
static DateTime DosTimeToDateTime(uint dateTime)
static uint DateTimeToDosTime(DateTime dateTime)
override long Seek(long offset, SeekOrigin loc)
override void Dispose(bool disposing)
override void CopyTo(Stream destination, int bufferSize)
static void ValidateBufferArguments(byte[] buffer, int offset, int count)
long Seek(long offset, SeekOrigin origin)
void CopyTo(Stream destination)
void Write(byte[] buffer, int offset, int count)
static string UnsupportedCompression
static string LengthAfterWrite
static string UpdateModeOneStream
static string FrozenAfterWrite
static string SeekingNotSupported
static string SetLengthRequiresSeekingAndWriting
static string ReadingNotSupported
static string CreateModeWriteOnceAndOneEntryAtATime
static string ReadOnlyArchive
static string Format(string resourceFormat, object p1)
static string DeleteOpenEntry
static string UnsupportedCompressionMethod
static string DeletedEntry
static string LocalFileHeaderCorrupt
static string DeleteOnlyInUpdate
static string SplitSpanned
static string EntryTooLarge
static string EntryNamesTooLong
static string DateTimeOutOfRange
static string HiddenStreamName
override bool Equals([NotNullWhen(true)] object? value)
virtual byte[] GetBytes(char[] chars)
unsafe string GetString(byte *bytes, int byteCount)
static DateTimeOffset Now