private static TypeInfo FindCompressor()

in src/DotPulsar/Internal/Compression/ZstdSharpCompression.cs [99:117]


    private static TypeInfo FindCompressor(IEnumerable<TypeInfo> types, string fullName)
    {
        foreach (var type in types)
        {
            if (type.FullName is null || !type.FullName.Equals(fullName))
                continue;

            if (type.IsPublic &&
                type.IsClass &&
                !type.IsAbstract &&
                type.ImplementedInterfaces.Contains(typeof(IDisposable)) &&
                type.GetConstructor(new[] { typeof(int) }) is not null)
                return type;

            break;
        }

        throw new Exception($"{fullName} as a public class with an public constructor taking an integer and implementing IDisposable was not found");
    }