private void method_25(Stream pageHeaderStream, Class617 section, Class616 page, int pageType) { Class889 class889 = Class889.Create(pageHeaderStream, this.dxfVersion_0, this.encoding_0); class889.vmethod_9(pageType); class889.vmethod_9(section.SectionId); class889.vmethod_9(page.CompressedSize); class889.vmethod_9(page.PageSize); class889.vmethod_13((long)page.StartOffset); class889.vmethod_11(page.HeaderChecksum); class889.vmethod_11(page.DataChecksum); }
protected void method_23(Class617 section, MemoryStream memoryStream, bool compress) { section.SectionSize = (ulong)memoryStream.Length; section.Compressed = compress ? 2 : 1; int decompressedPageSize = section.MaxDecompressedPageSize; int num1 = (int)(memoryStream.Length / (long)decompressedPageSize); byte[] buffer = memoryStream.GetBuffer(); ulong num2 = 0; for (int index = 0; index < num1; ++index) { this.method_24(section, 1097008187, decompressedPageSize, buffer, num2, decompressedPageSize, compress); num2 += (ulong)decompressedPageSize; } int uncompressedLength = (int)(memoryStream.Length % (long)decompressedPageSize); if (uncompressedLength <= 0 || Class885.smethod_1(buffer, num2, (ulong)uncompressedLength)) { return; } this.method_24(section, 1097008187, decompressedPageSize, buffer, num2, uncompressedLength, compress); int num3 = num1 + 1; }
private void method_24( Class617 section, int pageType, int maxPageSize, byte[] buffer, ulong position, int uncompressedLength, bool compress) { MemoryStream memoryStream1 = new MemoryStream(); if (compress) { MemoryStream memoryStream2 = new MemoryStream(maxPageSize); memoryStream2.Write(buffer, (int)position, uncompressedLength); int num = maxPageSize - uncompressedLength; for (int index = 0; index < num; ++index) { memoryStream2.WriteByte((byte)0); } new Class565().method_1(memoryStream2.GetBuffer(), 0, maxPageSize, (Stream)memoryStream1); } else { memoryStream1.Write(buffer, (int)position, uncompressedLength); int num = maxPageSize - uncompressedLength; for (int index = 0; index < num; ++index) { memoryStream1.WriteByte((byte)0); } } this.method_27(); long position1 = this.stream_0.Position; Class616 page = new Class616(); page.PageNumber = this.list_1.Count + 1; page.StartOffset = position; page.StreamOffset = position1; page.DataChecksum = Class998.smethod_1(0U, memoryStream1.GetBuffer(), 0, (int)memoryStream1.Length); uint dataChecksum = page.DataChecksum; int count = Class998.smethod_0((int)memoryStream1.Length); page.CompressedSize = (int)memoryStream1.Length; page.DecompressedSize = uncompressedLength; page.PageSize = page.CompressedSize + 32 + count; page.HeaderChecksum = 0U; MemoryStream memoryStream3 = new MemoryStream(32); this.method_25((Stream)memoryStream3, section, page, pageType); page.HeaderChecksum = Class998.smethod_1(dataChecksum, memoryStream3.GetBuffer(), 0, (int)memoryStream3.Length); memoryStream3.SetLength(0L); memoryStream3.Position = 0L; this.method_25((Stream)memoryStream3, section, page, pageType); this.method_26(memoryStream3.GetBuffer(), 0, (int)memoryStream3.Length); this.stream_0.Write(memoryStream3.GetBuffer(), 0, (int)memoryStream3.Length); this.stream_0.Write(memoryStream1.GetBuffer(), 0, (int)memoryStream1.Length); if (compress) { this.stream_0.Write(Class998.byte_0, 0, count); } else if (count != 0) { throw new Exception(); } if (page.PageNumber > 0) { ++section.PageCount; } page.Length = this.stream_0.Position - position1; section.Pages.Add(page); this.list_1.Add((Class614)page); }