public ZipEntry(ZipEntry entry) { this.externalFileAttributes = -1; this.method = Maticsoft.ZipLib.Zip.CompressionMethod.Deflated; this.zipFileIndex = -1L; if (entry == null) { throw new ArgumentNullException("entry"); } this.known = entry.known; this.name = entry.name; this.size = entry.size; this.compressedSize = entry.compressedSize; this.crc = entry.crc; this.dosTime = entry.dosTime; this.method = entry.method; this.comment = entry.comment; this.versionToExtract = entry.versionToExtract; this.versionMadeBy = entry.versionMadeBy; this.externalFileAttributes = entry.externalFileAttributes; this.flags = entry.flags; this.zipFileIndex = entry.zipFileIndex; this.offset = entry.offset; this.forceZip64_ = entry.forceZip64_; if (entry.extra != null) { this.extra = new byte[entry.extra.Length]; Array.Copy(entry.extra, 0, this.extra, 0, entry.extra.Length); } }
internal ZipEntry(string name, int versionRequiredToExtract, int madeByInfo, Maticsoft.ZipLib.Zip.CompressionMethod method) { this.externalFileAttributes = -1; this.method = Maticsoft.ZipLib.Zip.CompressionMethod.Deflated; this.zipFileIndex = -1L; if (name == null) { throw new ArgumentNullException("name"); } if (name.Length > 0xffff) { throw new ArgumentException("Name is too long", "name"); } if ((versionRequiredToExtract != 0) && (versionRequiredToExtract < 10)) { throw new ArgumentOutOfRangeException("versionRequiredToExtract"); } this.DateTime = System.DateTime.Now; this.name = name; this.versionMadeBy = (ushort) madeByInfo; this.versionToExtract = (ushort) versionRequiredToExtract; this.method = method; }
private void ProcessAESExtraData(ZipExtraData extraData) { if (!extraData.Find(0x9901)) { throw new ZipException("AES Extra Data missing"); } this.versionToExtract = 0x33; this.Flags |= 0x40; int valueLength = extraData.ValueLength; if (valueLength < 7) { throw new ZipException("AES Extra Data Length " + valueLength + " invalid."); } int num2 = extraData.ReadShort(); int num3 = extraData.ReadShort(); int num4 = extraData.ReadByte(); int num5 = extraData.ReadShort(); this._aesVer = num2; this._aesEncryptionStrength = num4; this.method = (Maticsoft.ZipLib.Zip.CompressionMethod) num5; }