registerProvider

fnvoid registerProvider(Provider provider)

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

This function is safe to call during module construction. Multiple providers can be registered for the same format and will be prioritized by Provider.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

providerProvider descriptor where provider.format specifies the associated CompressionFormat.

Throws

CompressionError if provider.format is

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