in src/DotPulsar/Internal/Compression/Lz4Compression.cs [155:175]
private static MaximumOutputSize FindMaximumOutputSize(MethodInfo[] methods)
{
const string name = "MaximumOutputSize";
foreach (var method in methods)
{
if (method.Name != name || method.ReturnType != typeof(int))
continue;
var parameters = method.GetParameters();
if (parameters.Length != 1)
continue;
if (parameters[0].ParameterType != typeof(int))
continue;
return (MaximumOutputSize) method.CreateDelegate(typeof(MaximumOutputSize));
}
throw new Exception($"A method with the name '{name}' matching the delegate was not found");
}