decodeWithCodec
decodeWithCodec(
instance
,binary
,mediaType
):Promise
<unknown
>
Defined in: astrobase/src/codecs/codecs.ts:68
Decodes binary data using the Codec for the media type, plus Middlewares, provided by the instance.
Parameters
Section titled “Parameters”instance
Section titled “instance”The instance that provides the Codec & Middlewares.
binary
Section titled “binary”Uint8Array
The binary data to decode.
mediaType
Section titled “mediaType”The media type of the data.
Returns
Section titled “Returns”Promise
<unknown
>
A promise that resolves with the decoded data. As we cannot anticipate how registered middleware will behave, the type of the output will be unknown. You will need to assert the output type yourself.