示例#1
0
        public virtual long CopyTo(Stream stream)
        {
            long position1 = stream.Position;

            stream.Write(BitConverter.GetBytes(this._index.Length), 0, 8);
            stream.Seek(stream.Position + 8L, SeekOrigin.Begin);
            long position2 = stream.Position;
            long num1      = position2 + this._index.Length * 8L;
            long pointer1  = 0;

            using (BinaryWriter stream1 = new BinaryWriter((Stream) new LimitedStream(stream, position2)))
            {
                using (BinaryWriter stream2 = new BinaryWriter((Stream) new LimitedStream(stream, num1)))
                {
                    for (int index1 = 0; (long)index1 < this._index.Length; ++index1)
                    {
                        stream2.SeekBegin(pointer1 * 4L);
                        long pointer2;
                        int  size;
                        ShapesArray.ExtractPointerAndSize(this._index[(long)index1], out pointer2, out size);
                        if (size >= 0)
                        {
                            for (int index2 = 0; index2 < size; ++index2)
                            {
                                stream2.Write(this._coordinates[pointer2 + (long)(index2 * 2)]);
                                stream2.Write(this._coordinates[pointer2 + (long)(index2 * 2) + 1L]);
                            }
                            stream1.SeekBegin((long)(index1 * 8));
                            stream1.Write(ShapesArray.BuildPointerAndSize(pointer1, size));
                            pointer1 += (long)(size * 2);
                        }
                    }
                }
            }
            stream.Seek(position1 + 8L, SeekOrigin.Begin);
            stream.Write(BitConverter.GetBytes(pointer1), 0, 8);
            long num2 = 16L + this._index.Length * 8L + pointer1 * 4L;

            stream.Seek(position1 + num2, SeekOrigin.Begin);
            return(num2);
        }
示例#2
0
 private void SetPointerAndSize(long id, long pointer, int size)
 {
     this._index[id] = ShapesArray.BuildPointerAndSize(pointer, size);
 }