Example #1
0
            internal override void vmethod_0(Class741.Class742 serializer)
            {
                Class889 stream    = serializer.Stream;
                long     position1 = stream.Position;
                int      num1      = (this.list_0.Count * 20 + 16) / 16;

                for (int index1 = 0; index1 < num1; ++index1)
                {
                    for (int index2 = 0; index2 < 16; ++index2)
                    {
                        stream.vmethod_1((byte)98);
                    }
                }
                this.DataOffset = (ulong)stream.Position;
                for (int index = 0; index < this.list_0.Count; ++index)
                {
                    uint num2 = (uint)((ulong)stream.Position - this.DataOffset);
                    Class49.Class52.Class60 class60 = this.list_0[index];
                    if (class60.ReferencedObject == null)
                    {
                        throw new Exception("Entry's ReferencedObject property is null.");
                    }
                    class60.ReferencedObject.Write(stream);
                    class60.LocalOffset = num2;
                }
                long position2 = stream.Position;

                stream.Position = position1;
                for (int index = 0; index < this.list_0.Count; ++index)
                {
                    serializer.DataIndex.Entries.Add(new Class49.Class54.Class64()
                    {
                        SegmentIndex = this.class681_0.SegmentIndex,
                        LocalOffset  = (uint)(stream.Position - position1)
                    });
                    this.list_0[index].Write(stream);
                }
                stream.Position = position2;
            }
Example #2
0
            internal override void Read(Class741.Class742 serializer)
            {
                base.Read(serializer);
                Class889 stream   = serializer.Stream;
                long     position = stream.Position;
                List <Class49.Class54.Class64> toDataIndexEntry = serializer.SegmentIndexToDataIndexEntries[this.class681_0.SegmentIndex];
                int count = toDataIndexEntry.Count;

                this.list_0.Capacity = count;
                for (int index = 0; index < count; ++index)
                {
                    stream.Position = position + (long)toDataIndexEntry[index].LocalOffset;
                    Class49.Class52.Class60 class60 = new Class49.Class52.Class60();
                    if (class60.Read(stream))
                    {
                        this.list_0.Add(class60);
                    }
                }
                if (this.list_0.Count <= 0)
                {
                    return;
                }
                long dataOffset = (long)this.DataOffset;
                int  num        = this.list_0.Count - 1;
                int  index1;

                for (index1 = 0; index1 < num; ++index1)
                {
                    stream.Position = dataOffset + (long)this.list_0[index1].LocalOffset;
                    uint maxRawSize = this.list_0[index1 + 1].LocalOffset - this.list_0[index1].LocalOffset;
                    this.method_1(stream, index1, maxRawSize);
                }
                stream.Position = dataOffset + (long)this.list_0[index1].LocalOffset;
                uint maxRawSize1 = (uint)((ulong)-(long)this.class681_0.ObjectDataLocalOffset + (ulong)this.class681_0.SegmentSize - (ulong)this.list_0[index1].LocalOffset);

                this.method_1(stream, index1, maxRawSize1);
            }