Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DefaultTranscoder

The default transcoder implements cross-sdk transcoding capabilities by taking advantage of the common flags specification to ensure compatibility. This transcoder is capable of encoding/decoding any value which is encodable to JSON, and additionally has special-case handling for Buffer objects.

Hierarchy

  • DefaultTranscoder

Implements

Index

Constructors

Methods

Constructors

constructor

Methods

decode

  • decode(bytes: Buffer, flags: number): any
  • Decodes a buffer and flags tuple back to the original type of the document.

    Parameters

    • bytes: Buffer

      The bytes that were previously encoded.

    • flags: number

      The flags associated with the data.

    Returns any

encode

  • encode(value: any): [Buffer, number]
  • Encodes the specified value, returning a buffer and flags that are stored to the server and later used for decoding.

    Parameters

    • value: any

      The value to encode.

    Returns [Buffer, number]

Generated using TypeDoc