Skip to content

encodeWithCodec

encodeWithCodec(instance, input, mediaType): Promise<Uint8Array<ArrayBufferLike>>

Defined in: astrobase/src/codecs/codecs.ts:90

Encodes data into binary using the Codec for the media type, plus Middlewares, provided by the instance.

Instance

The instance that provides the Codec & Middlewares.

unknown

The data to encode.

MediaTypeLike

The media type of the encoding.

Promise<Uint8Array<ArrayBufferLike>>

A promise that resolves with the encoded binary.