// Token: 0x06000600 RID: 1536 RVA: 0x000265DC File Offset: 0x000247DC protected virtual void lmethod_1058(bool bool_0) { if (this.field_12) { return; } if (bool_0 && !this.field_13) { this.kmethod_1057(); this.field_15 = Class_173.WriteCentralDirectoryStructure(this.field_4, this.field_7.Values, 1U, this.field_6, this.prop_7, new Class_178(this)); Class_156 class_ = this.field_4 as Class_156; Stream stream; if (class_ != null) { stream = class_.prop_0; class_.Dispose(); } else { stream = this.field_4; } if (!this.field_11) { stream.Dispose(); } this.field_4 = null; } this.field_12 = true; }
// Token: 0x06000597 RID: 1431 RVA: 0x00025280 File Offset: 0x00023480 public static bool WriteCentralDirectoryStructure(Stream s, ICollection <Class_163> entries, uint numSegments, Class_169 zip64, string comment, Class_178 container) { Class_179 class_ = s as Class_179; if (class_ != null) { class_.prop_0 = true; } long num = 0L; using (MemoryStream memoryStream = new MemoryStream()) { foreach (Class_163 class_2 in entries) { if (class_2.prop_34) { class_2.lmethod_718(memoryStream); } } byte[] array = memoryStream.ToArray(); s.Write(array, 0, array.Length); num = (long)array.Length; } Class_156 class_3 = s as Class_156; long num2 = (class_3 != null) ? class_3.prop_7 : s.Position; long num3 = num2 - num; uint num4 = (class_ != null) ? class_.prop_1 : 0U; long num5 = num2 - num3; int num6 = Class_173.CountEntries(entries); bool flag = zip64 == Class_169.Always || num6 >= 65535 || num5 > (long)((ulong)-1) || num3 > (long)((ulong)-1); byte[] array3; if (flag) { if (zip64 == Class_169.Default) { StackFrame stackFrame = new StackFrame(1); if (stackFrame.GetMethod().DeclaringType == typeof(Class_168)) { throw new Class_135("The archive requires a ZIP64 Central Directory. Consider setting the ZipFile.UseZip64WhenSaving property."); } throw new Class_135("The archive requires a ZIP64 Central Directory. Consider setting the ZipOutputStream.EnableZip64 property."); } else { byte[] array2 = Class_173.GenZip64EndOfCentralDirectory(num3, num2, num6, numSegments); array3 = Class_173.GenCentralDirectoryFooter(num3, num2, zip64, num6, comment, container); if (num4 != 0U) { uint value = class_.dmethod_1096(array2.Length + array3.Length); int num7 = 16; Array.Copy(BitConverter.GetBytes(value), 0, array2, num7, 4); num7 += 4; Array.Copy(BitConverter.GetBytes(value), 0, array2, num7, 4); num7 = 60; Array.Copy(BitConverter.GetBytes(value), 0, array2, num7, 4); num7 += 4; num7 += 8; Array.Copy(BitConverter.GetBytes(value), 0, array2, num7, 4); } s.Write(array2, 0, array2.Length); } } else { array3 = Class_173.GenCentralDirectoryFooter(num3, num2, zip64, num6, comment, container); } if (num4 != 0U) { ushort value2 = (ushort)class_.dmethod_1096(array3.Length); int num8 = 4; Array.Copy(BitConverter.GetBytes(value2), 0, array3, num8, 2); num8 += 2; Array.Copy(BitConverter.GetBytes(value2), 0, array3, num8, 2); num8 += 2; } s.Write(array3, 0, array3.Length); if (class_ != null) { class_.prop_0 = false; } return(flag); }