2 writes to _archiveStream
System.IO.Compression (2)
System\IO\Compression\ZipArchive.cs (2)
140
_archiveStream
= DecideArchiveStream(mode, stream);
184
_archiveStream
= archiveStream;
54 references to _archiveStream
System.IO.Compression (54)
System\IO\Compression\ZipArchive.Async.cs (21)
98
if (zipArchive.
_archiveStream
.Length == 0)
160
await
_archiveStream
.DisposeAsync().ConfigureAwait(false);
173
await
_archiveStream
.DisposeAsync().ConfigureAwait(false);
201
int currBytesRead = await
_archiveStream
.ReadAtLeastAsync(fileBuffer, ZipCentralDirectoryFileHeader.BlockConstantSectionSize, throwOnEndOfStream: false, cancellationToken).ConfigureAwait(false);
209
await ZipCentralDirectoryFileHeader.TryReadBlockAsync(sizedFileBuffer.AsMemory(currPosition),
_archiveStream
, saveExtraFieldsAndComments, cancellationToken).ConfigureAwait(false);
240
_archiveStream
.Seek(-ZipEndOfCentralDirectoryBlock.SizeOfBlockWithoutSignature, SeekOrigin.End);
244
if (!await ZipHelper.SeekBackwardsToSignatureAsync(
_archiveStream
,
250
long eocdStart =
_archiveStream
.Position;
253
ZipEndOfCentralDirectoryBlock eocd = await ZipEndOfCentralDirectoryBlock.ReadBlockAsync(
_archiveStream
, cancellationToken).ConfigureAwait(false);
259
if (_centralDirectoryStart >
_archiveStream
.Length)
296
_archiveStream
.Seek(eocdStart - Zip64EndOfCentralDirectoryLocator.SizeOfBlockWithoutSignature, SeekOrigin.Begin);
300
if (await ZipHelper.SeekBackwardsToSignatureAsync(
_archiveStream
,
305
Zip64EndOfCentralDirectoryLocator locator = await Zip64EndOfCentralDirectoryLocator.TryReadBlockAsync(
_archiveStream
, cancellationToken).ConfigureAwait(false);
309
Zip64EndOfCentralDirectoryRecord record = await Zip64EndOfCentralDirectoryRecord.TryReadBlockAsync(
_archiveStream
, cancellationToken).ConfigureAwait(false);
378
long plannedCentralDirectoryPosition =
_archiveStream
.Position;
392
long sizeOfCentralDirectory =
_archiveStream
.Position - plannedCentralDirectoryPosition;
415
long zip64EOCDRecordStart =
_archiveStream
.Position;
419
await Zip64EndOfCentralDirectoryRecord.WriteBlockAsync(
_archiveStream
, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory, cancellationToken).ConfigureAwait(false);
420
await Zip64EndOfCentralDirectoryLocator.WriteBlockAsync(
_archiveStream
, zip64EOCDRecordStart, cancellationToken).ConfigureAwait(false);
431
await ZipEndOfCentralDirectoryBlock.WriteBlockAsync(
_archiveStream
, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory, _archiveComment, cancellationToken).ConfigureAwait(false);
435
_archiveStream
.Seek(ZipEndOfCentralDirectoryBlock.TotalSize + _archiveComment.Length, SeekOrigin.Current);
System\IO\Compression\ZipArchive.cs (33)
153
if (
_archiveStream
.Length == 0)
342
internal Stream ArchiveStream =>
_archiveStream
;
456
_archiveStream
.Dispose();
465
_archiveStream
.Dispose();
486
_archiveStream
.Seek(_centralDirectoryStart, SeekOrigin.Begin);
531
_archiveStream
.Seek(-(sizedFileBuffer.Length - currPosition), SeekOrigin.Current);
563
int currBytesRead =
_archiveStream
.ReadAtLeast(fileBufferSpan, ZipCentralDirectoryFileHeader.BlockConstantSectionSize, throwOnEndOfStream: false);
570
bool result = ZipCentralDirectoryFileHeader.TryReadBlock(sizedFileBuffer.Slice(currPosition),
_archiveStream
,
616
_archiveStream
.Seek(-ZipEndOfCentralDirectoryBlock.SizeOfBlockWithoutSignature, SeekOrigin.End);
620
if (!ZipHelper.SeekBackwardsToSignature(
_archiveStream
,
625
long eocdStart =
_archiveStream
.Position;
628
ZipEndOfCentralDirectoryBlock eocd = ZipEndOfCentralDirectoryBlock.ReadBlock(
_archiveStream
);
634
if (_centralDirectoryStart >
_archiveStream
.Length)
656
if (zip64EOCDOffset < 0 || zip64EOCDOffset >
_archiveStream
.Length)
659
_archiveStream
.Seek(zip64EOCDOffset, SeekOrigin.Begin);
699
_archiveStream
.Seek(eocdStart - Zip64EndOfCentralDirectoryLocator.SizeOfBlockWithoutSignature, SeekOrigin.Begin);
703
if (ZipHelper.SeekBackwardsToSignature(
_archiveStream
,
708
Zip64EndOfCentralDirectoryLocator locator = Zip64EndOfCentralDirectoryLocator.TryReadBlock(
_archiveStream
);
712
Zip64EndOfCentralDirectoryRecord record = Zip64EndOfCentralDirectoryRecord.TryReadBlock(
_archiveStream
);
753
_archiveStream
.Seek(startingOffset, SeekOrigin.Begin);
760
if (_mode == ZipArchiveMode.Update &&
_archiveStream
.Position !=
_archiveStream
.Length)
762
_archiveStream
.SetLength(
_archiveStream
.Position);
825
long plannedCentralDirectoryPosition =
_archiveStream
.Position;
839
long sizeOfCentralDirectory =
_archiveStream
.Position - plannedCentralDirectoryPosition;
848
_archiveStream
.Seek(Zip64EndOfCentralDirectoryRecord.TotalSize, SeekOrigin.Current);
849
_archiveStream
.Seek(Zip64EndOfCentralDirectoryLocator.TotalSize, SeekOrigin.Current);
866
long zip64EOCDRecordStart =
_archiveStream
.Position;
870
Zip64EndOfCentralDirectoryRecord.WriteBlock(
_archiveStream
, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory);
871
Zip64EndOfCentralDirectoryLocator.WriteBlock(
_archiveStream
, zip64EOCDRecordStart);
882
ZipEndOfCentralDirectoryBlock.WriteBlock(
_archiveStream
, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory, _archiveComment);
886
_archiveStream
.Seek(ZipEndOfCentralDirectoryBlock.TotalSize + _archiveComment.Length, SeekOrigin.Current);