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));
}