registerProvider

fnvoid registerProvider(CompressionProvider provider)

Register a provider for a given format as specified by provider.format.

This function is safe to call during module construction and from multiple threads; the registry is internally synchronized. Multiple providers can be registered for the same format and will be prioritized by CompressionProvider.priority when selected via makeCompressor and makeDecompressor.

String format ids (for use with makeCompressorById / makeDecompressorById) are no longer derived from provider.vendor at registration time. Instead, those helpers map a textual formatId (such as "gzip", "deflate", or "unix") to the corresponding CompressionFormat value and then use the enum-based registry.

Parameters

providerCompressionProvider descriptor where provider.format specifies the associated CompressionFormat.

Throws

CompressionError if provider.format is

CompressionFormat.autoDetect, or if provider.vendor is empty.