Writer for TL objects.

Constructors

  • Parameters

    • objectMap: undefined | TlWriterMap

      Writers map

    • data: ArrayBuffer
    • start: number = 0

      Position to start writing at

    Returns TlBinaryWriter

Properties

dataView: DataView
objectMap: undefined | TlWriterMap

Writers map

pos: number

Current position in the buffer.

uint8View: Uint8Array

Methods

  • Parameters

    • val: boolean

    Returns void

  • Parameters

    • val: Uint8Array

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    • val: Uint8Array

    Returns void

  • Parameters

    • val: Uint8Array

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    Returns void

  • Returns void

  • Parameters

    • obj: any

    Returns void

  • Write raw bytes to the buffer

    Parameters

    • val: Uint8Array

      Buffer to write

    Returns void

  • Get the resulting buffer

    Returns Uint8Array

  • Parameters

    • val: string

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    • fn: (item: unknown, bare?: boolean) => void
    • val: unknown[]
    • Optionalbare: boolean

    Returns void

  • Create a new writer with the given size.

    Parameters

    • objectMap: undefined | TlWriterMap

      Writers map

    • size: number

      Size of the writer's buffer

    Returns TlBinaryWriter

  • Create a new writer without objects map for manual usage

    Parameters

    • buffer: number | ArrayBuffer

      Buffer to write to, or its size

    • start: number = 0

      Position to start writing at

    Returns TlBinaryWriter

  • Serialize a single object

    Parameters

    • objectMap: TlWriterMap

      Writers map

    • obj: { _: string }

      Object to serialize

    • knownSize: number = -1

      In case the size is known, pass it here

    Returns Uint8Array