示例#1
0
文件: Class499.cs 项目: 15831944/WW
        private void method_18()
        {
            this.method_27();
            Class615 page = new Class615(1097010747);

            this.method_19(page);
            int pageSize = this.list_1.Count * 8;

            page.StreamOffset = this.stream_0.Position;
            int num = pageSize + Class998.smethod_0(pageSize);

            page.Length = (long)num;
            MemoryStream sectionStream = new MemoryStream();
            Class889     class889      = Class889.Create((Stream)sectionStream, this.dxfVersion_0, this.encoding_0);

            foreach (Class614 class614 in this.list_1)
            {
                if (class614 != null)
                {
                    class889.vmethod_9(class614.PageNumber);
                    class889.vmethod_9((int)class614.Length);
                }
            }
            this.method_21(page, sectionStream);
            Class614 class614_1 = this.list_1[this.list_1.Count - 1];

            this.class564_0.LastPageId        = class614_1.PageNumber;
            this.class564_0.LastPageEndOffset = (ulong)(class614_1.StreamOffset + (long)num - 256L);
            this.class564_0.GapCount          = 0U;
            this.class564_0.PageCount         = (uint)(this.list_1.Count - 1);
            this.class564_0.PagesMapOffset    = (ulong)page.StreamOffset;
        }
示例#2
0
文件: Class499.cs 项目: 15831944/WW
        private void method_17()
        {
            MemoryStream sectionStream = new MemoryStream();
            Class889     class889      = Class889.Create((Stream)sectionStream, this.dxfVersion_0, this.encoding_0);

            class889.vmethod_9(this.list_0.Count);
            class889.vmethod_9(2);
            class889.vmethod_9(29696);
            class889.vmethod_9(0);
            class889.vmethod_9(this.list_0.Count);
            foreach (Class617 class617 in this.list_0)
            {
                class889.vmethod_15(class617.SectionSize);
                class889.vmethod_9(class617.PageCount);
                class889.vmethod_9(class617.MaxDecompressedPageSize);
                class889.vmethod_9(1);
                class889.vmethod_9(class617.Compressed);
                class889.vmethod_9(class617.SectionId);
                class889.vmethod_9(class617.Encrypted);
                byte[] buffer = new byte[64];
                if (!string.IsNullOrEmpty(class617.Name))
                {
                    byte[] bytes = Encodings.Ascii.GetBytes(class617.Name);
                    int    num   = Math.Min(bytes.Length, buffer.Length);
                    for (int index = 0; index < num; ++index)
                    {
                        buffer[index] = bytes[index];
                    }
                }
                sectionStream.Write(buffer, 0, buffer.Length);
                foreach (Class616 page in class617.Pages)
                {
                    if (page.PageNumber > 0)
                    {
                        class889.vmethod_9(page.PageNumber);
                        class889.vmethod_9(page.CompressedSize);
                        class889.vmethod_15(page.StartOffset);
                    }
                }
            }
            Class615 page1 = this.method_20(1097007163, sectionStream);
            int      count = Class998.smethod_0((int)(this.stream_0.Position - page1.StreamOffset));

            this.stream_0.Write(Class998.byte_0, 0, count);
            page1.Length = this.stream_0.Position - page1.StreamOffset;
            this.method_19(page1);
        }
示例#3
0
文件: Class499.cs 项目: 15831944/WW
        private void method_21(Class615 page, MemoryStream sectionStream)
        {
            page.DecompressedSize = (int)sectionStream.Length;
            Class565     class565      = new Class565();
            MemoryStream memoryStream1 = new MemoryStream();

            class565.method_1(sectionStream.GetBuffer(), 0, (int)sectionStream.Length, (Stream)memoryStream1);
            page.CompressedSize = (int)memoryStream1.Length;
            MemoryStream memoryStream2 = new MemoryStream();

            this.method_22(page, (Stream)memoryStream2);
            page.Checksum = Class998.smethod_1(0U, memoryStream2.GetBuffer(), 0, (int)memoryStream2.Length);
            page.Checksum = Class998.smethod_1(page.Checksum, memoryStream1.GetBuffer(), 0, (int)memoryStream1.Length);
            this.method_22(page, this.stream_0);
            this.stream_0.Write(memoryStream1.GetBuffer(), 0, (int)memoryStream1.Length);
            this.method_22(new Class615(page.SectionPageType), this.stream_0);
        }
示例#4
0
文件: Class499.cs 项目: 15831944/WW
        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);
        }