Beispiel #1
0
        public T Deserialize(SerializerInput input)
        {
            T   item         = default;
            var childAddress = Unsafe.AsPointer(ref item);

            _methods.Read(childAddress, input);
            return(item);
        }
Beispiel #2
0
        public override void Read(void *fieldAddress, SerializerInput input)
        {
            TMember def = default;
            var     ptr = Unsafe.AsPointer(ref def);

            _dataSerializer.Read(ptr, input);
            _set(Unsafe.Read <T>(fieldAddress), def);
        }
Beispiel #3
0
        public override void Read(void *fieldAddress, SerializerInput input)
        {
            var obj = Unsafe.Read <object>(fieldAddress);//obj should not be null here

            var pinnable = Unsafe.As <object, PinnableObject>(ref obj);

            fixed(byte *objectAddress = &pinnable.Pinnable)
            {
                _dataSerializer.Read(objectAddress + _fieldOffset, input);
            }
        }
Beispiel #4
0
        public override void Read(void *fieldAddress, SerializerInput input)
        {
            var address = (byte *)fieldAddress + _fieldOffset;

            _dataSerializer.Read(address, input);
        }