Example #1
0
 // Methods
 private ZipIORawDataFileBlock(ZipIOBlockManager blockManager)
 {
     this._blockManager = blockManager;
 }
Example #2
0
        internal static ZipIOLocalFileDataDescriptor ParseRecord(BinaryReader reader, long compressedSizeFromCentralDir, long uncompressedSizeFromCentralDir, uint crc32FromCentralDir, ushort versionNeededToExtract)
        {
            ZipIOLocalFileDataDescriptor descriptor = new ZipIOLocalFileDataDescriptor();

            uint[] numArray = new uint[6];
            numArray[0] = reader.ReadUInt32();
            numArray[1] = reader.ReadUInt32();
            numArray[2] = reader.ReadUInt32();
            if (descriptor.TestMatch(0x8074b50, crc32FromCentralDir, compressedSizeFromCentralDir, uncompressedSizeFromCentralDir, 0x8074b50, numArray[0], (ulong)numArray[1], (ulong)numArray[2]))
            {
                descriptor._size = 12;
                return(descriptor);
            }
            numArray[3] = reader.ReadUInt32();
            if (descriptor.TestMatch(0x8074b50, crc32FromCentralDir, compressedSizeFromCentralDir, uncompressedSizeFromCentralDir, numArray[0], numArray[1], (ulong)numArray[2], (ulong)numArray[3]))
            {
                descriptor._size = 0x10;
                return(descriptor);
            }
            if (versionNeededToExtract < 0x2d)
            {
                throw new FileFormatException(SR.Get("CorruptedData"));
            }
            numArray[4] = reader.ReadUInt32();
            if (descriptor.TestMatch(0x8074b50, crc32FromCentralDir, compressedSizeFromCentralDir, uncompressedSizeFromCentralDir, 0x8074b50, numArray[0], ZipIOBlockManager.ConvertToUInt64(numArray[1], numArray[2]), ZipIOBlockManager.ConvertToUInt64(numArray[3], numArray[4])))
            {
                descriptor._size = 20;
                return(descriptor);
            }
            numArray[5] = reader.ReadUInt32();
            if (!descriptor.TestMatch(0x8074b50, crc32FromCentralDir, compressedSizeFromCentralDir, uncompressedSizeFromCentralDir, numArray[0], numArray[1], ZipIOBlockManager.ConvertToUInt64(numArray[2], numArray[3]), ZipIOBlockManager.ConvertToUInt64(numArray[4], numArray[5])))
            {
                throw new FileFormatException(SR.Get("CorruptedData"));
            }
            descriptor._size = 0x18;
            return(descriptor);
        }
 // Methods
 private ZipIOZip64EndOfCentralDirectoryLocatorBlock(ZipIOBlockManager blockManager)
 {
     this._blockManager = blockManager;
 }
Example #4
0
 // Methods
 private ZipIOLocalFileBlock(ZipIOBlockManager blockManager, bool folderFlag, bool volumeLabelFlag)
 {
     this._blockManager    = blockManager;
     this._folderFlag      = folderFlag;
     this._volumeLabelFlag = volumeLabelFlag;
 }
Example #5
0
 internal PreSaveNotificationScanControlInstruction PreSaveNotification(long offset, long size)
 {
     return(ZipIOBlockManager.CommonPreSaveNotificationHandler(this._blockManager.Stream, offset, size, this._persistedOffset, Math.Min(this._persistedSize, this._currentStreamLength), ref this._cachePrefixStream));
 }
Example #6
0
 // Methods
 internal ProgressiveCrcCalculatingStream(ZipIOBlockManager blockManager, Stream underlyingStream)
     : this(blockManager, underlyingStream, 0)
 {
     this._validateCrcWithExpectedCrc = false;
 }
 // Methods
 private ZipIOCentralDirectoryBlock(ZipIOBlockManager blockManager)
 {
     this._blockManager = blockManager;
 }
Example #8
0
 internal bool FileExists(string zipFileName)
 {
     this.CheckDisposed();
     zipFileName = ZipIOBlockManager.ValidateNormalizeFileName(zipFileName);
     return(this._blockManager.CentralDirectoryBlock.FileExists(zipFileName));
 }