Class ContentDecoderRegistry
- Namespace
- Fluxzy
- Assembly
- Fluxzy.Core.dll
A process-wide registry of IContentDecoder instances allowing callers to plug in
decoders for HTTP content-encodings the .NET runtime cannot decode natively (e.g. compress/LZW,
zstd).
gzip, deflate and brotli are always handled by Fluxzy and do not need to be registered.
public static class ContentDecoderRegistry
- Inheritance
-
ContentDecoderRegistry
- Inherited Members
Remarks
The goal of this extension point is to keep Fluxzy.Core free of extra third-party dependencies:
a caller that needs an additional encoding brings the decoding library of their choice and registers
it here. When Fluxzy encounters an encoding with no registered decoder it throws a
FluxzyException rather than silently leaving the body encoded.
Methods
Contains(string)
Returns true if a decoder is registered for encodingToken (case-insensitive).
public static bool Contains(string encodingToken)
Parameters
encodingTokenstring
Returns
Register(IContentDecoder)
Registers (or replaces) a decoder for its EncodingToken.
public static void Register(IContentDecoder decoder)
Parameters
decoderIContentDecoder
Register(string, Func<Stream, Stream>)
Registers (or replaces) a decoder for encodingToken from a delegate.
public static void Register(string encodingToken, Func<Stream, Stream> factory)
Parameters
TryGet(string, out IContentDecoder)
Attempts to resolve a registered decoder for encodingToken (case-insensitive).
public static bool TryGet(string encodingToken, out IContentDecoder decoder)
Parameters
encodingTokenstringdecoderIContentDecoder
Returns
Unregister(string)
Removes the decoder registered for encodingToken, if any.
public static bool Unregister(string encodingToken)
Parameters
encodingTokenstring