public T Deserialize(SerializerInput input) { T item = default; var childAddress = Unsafe.AsPointer(ref item); _methods.Read(childAddress, input); return(item); }
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); }
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); } }
public override void Read(void *fieldAddress, SerializerInput input) { var address = (byte *)fieldAddress + _fieldOffset; _dataSerializer.Read(address, input); }