BTDB.EventStoreLayer.ByteArrayTypeDescriptor.GenerateLoad C# (CSharp) Method

GenerateLoad() public method

public GenerateLoad ( IILGen ilGenerator, Action pushReader, Action pushCtx, Action pushDescriptor, Type targetType ) : void
ilGenerator IILGen
pushReader Action
pushCtx Action
pushDescriptor Action
targetType System.Type
return void
        public void GenerateLoad(IILGen ilGenerator, Action<IILGen> pushReader, Action<IILGen> pushCtx, Action<IILGen> pushDescriptor, Type targetType)
        {
            pushReader(ilGenerator);
            ilGenerator.Call(() => default(AbstractBufferedReader).ReadByteArray());
            if (targetType == typeof (ByteBuffer))
            {
                ilGenerator.Call(() => ByteBuffer.NewAsync(null));
                return;
            }
            if (targetType != typeof (object))
            {
                if (targetType!=typeof(byte[]))
                    throw new ArgumentOutOfRangeException(nameof(targetType));
                return;
            }
            ilGenerator.Castclass(typeof(object));
        }