dwalluck commented on PR #666:
URL: https://github.com/apache/commons-compress/pull/666#issuecomment-2821432569

   > In any case, I'm OK with the lower-level class _not_ trying to be clever 
using `ZstdUtils.isZstdCompressionAvailable()`.
   
   Yes, this seems fine. I guess my point was that at the point where you call 
it, it's obviously available and the zstd classes is loaded.
   
   But without this change, in _my_ code, since I don't have a reference to the 
class yet, I think I would have to use reflection do something like:
   
   ```java
   if (ZstdUtils.isZstdCompressionAvailable()) {
       try {
           Integer minCompressionLevel = (Integer) 
Class.forName("com.github.luben.zstd.Zstd")
                                                        
.getMethod("minCompressionLevel").invoke(null);
       } catch (Exception e) {
   
       }
   }
   ```
   
   Anyway, this is good and removes the need for any of that. Thanks!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to