예제 #1
0
        public MyClass_ObjectSegment(DirtyTracker dirtyTracker, ArraySegment <byte> originalBytes)
        {
            var __array = originalBytes.Array;
            int __out;

            this.__originalBytes   = originalBytes;
            this.__tracker         = dirtyTracker = dirtyTracker.CreateChild();
            this.__binaryLastIndex = BinaryUtil.ReadInt32(ref __array, originalBytes.Offset + 4);

            this.__extraFixedBytes = ObjectSegmentHelper.CreateExtraFixedBytes(this.__binaryLastIndex, 4, new[] { 4, 4 }); // embed schemaLastIndex, elementSizeSum = should calcurate

            // Auto Generate Area
            _firstName = new CacheSegment <string>(__tracker, ObjectSegmentHelper.GetSegment(originalBytes, 1, __binaryLastIndex, __tracker));
            _lastName  = new CacheSegment <string>(__tracker, ObjectSegmentHelper.GetSegment(originalBytes, 2, __binaryLastIndex, __tracker));
            _myList    = Formatter <IList <int> > .Default.Deserialize(ref __array, ObjectSegmentHelper.GetOffset(originalBytes, 4, __binaryLastIndex, __tracker), __tracker, out __out);
        }