Reader for TL objects.

Constructors

  • Parameters

    • objectsMap: undefined | TlReaderMap

      Readers map

    • data: ArrayBuffer | ArrayBufferView

      Buffer to read from

    • start: number = 0

      Position to start reading from

    Returns TlBinaryReader

Properties

dataView: DataView
objectsMap: undefined | TlReaderMap

Readers map

pos: number = 0
uint8View: Uint8Array
platform: ITlPlatform

Methods

  • Parameters

    • id: number = ...

    Returns unknown

  • Get the next uint without advancing the reader cursor

    Returns number

  • Read raw bytes of the given length

    Parameters

    • bytes: number = -1

      Length of the buffer to read

    Returns Uint8Array

  • Advance the reader cursor by the given amount of bytes

    Parameters

    • delta: number

      Amount of bytes to advance (can be negative)

    Returns void

  • Seek to the given position

    Parameters

    • pos: number

      Position to seek to

    Returns void

  • Parameters

    • reader: ((id?: number) => unknown) = ...
        • (id?): unknown
        • Parameters

          • Optionalid: number

          Returns unknown

    • bare: boolean = false

    Returns unknown[]

  • Deserialize a single object

    Type Parameters

    • T

    Parameters

    • objectsMap: TlReaderMap

      Readers map

    • data: Uint8Array

      Buffer to read from

    • start: number = 0

      Position to start reading from

    Returns T

  • Create a new reader without objects map for manual usage

    Parameters

    • data: ArrayBuffer | ArrayBufferView

      Buffer to read from

    • start: number = 0

      Position to start reading from

    Returns TlBinaryReader