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

  • Parameters

    • val: Uint8Array

    Returns void

  • Parameters

    • obj: {
          _: string;
      }
      • _: string

    Returns void

  • Parameters

    • val: Uint8Array

    Returns void

  • Parameters

    • val: string

    Returns void

  • Parameters

    • fn: ((item: unknown) => void)
        • (item): void
        • Parameters

          • item: unknown

          Returns 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

      • _: string

    Returns number