Counter of the required number of bytes to encode a given object.

Used as a pre-pass before using TlBinaryWriter to avoid unnecessary allocations.

Constructors

Properties

count: number = 0
objectMap: TlWriterMap

Writers map

Methods

  • Returns void

  • Parameters

    • val: Uint8Array

    Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Parameters

    • obj: { _: string }

    Returns void

  • Parameters

    • val: Uint8Array

    Returns void

  • Parameters

    • val: string

    Returns void

  • Returns void

  • Parameters

    • fn: (item: unknown) => void
    • items: unknown[]

    Returns void

  • Count overhead in bytes for the given number of bytes when encoded as bytes TL type.

    Parameters

    • size: number

      Number of bytes

    Returns number

  • Count bytes required to serialize the given object.

    Parameters

    • objectMap: TlWriterMap

      Writers map

    • obj: { _: string }

      Object to count bytes for

    Returns number