private static MethodInfo FindUnwrap()

in src/DotPulsar/Internal/Compression/ZstdSharpCompression.cs [138:160]


    private static MethodInfo FindUnwrap(MethodInfo[] methods)
    {
        const string name = "Unwrap";

        foreach (var method in methods)
        {
            if (method.Name != name || method.ReturnType != typeof(int))
                continue;

            var parameters = method.GetParameters();
            if (parameters.Length != 3)
                continue;

            if (parameters[0].ParameterType != typeof(byte[]) ||
                parameters[1].ParameterType != typeof(byte[]) ||
                parameters[2].ParameterType != typeof(int))
                continue;

            return method;
        }

        throw new Exception($"A method with the name '{name}' matching the delegate was not found");
    }