@tgsnake/skema
    Preparing search index...

    Class Int128

    tgsnake - Telegram MTProto library for javascript or typescript. Copyright (C) 2025 tgsnake https://github.com/tgsnake

    THIS FILE IS PART OF TGSNAKE

    tgsnake is a free software: you can redistribute it and/or modify it under the terms of the MIT License as published.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _slots: string[]

    Internal array of slot names for the object.

    className: string

    Name of the class.

    classType: string

    Type of the class.

    cls: any = ...

    Reference to the constructor of the current class (late static binding).

    constructorId: number

    Unique identifier for the constructor.

    subclassOfId: number

    Identifier for the parent class (if any).

    SIZE: number = 16

    Methods

    • Reads data from the provided BytesIO instance and processes it using the associated class's read method.

      Parameters

      • data: BytesIO

        The BytesIO instance containing the data to be read.

      • ...args: any[]

        Additional arguments to be passed to the class's read method.

      Returns Promise<any>

      A promise that resolves with the result of the read operation.

    • Serializes the provided arguments using the associated class's write method.

      Parameters

      • ...args: any[]

        The arguments to be serialized.

      Returns Buffer

      The resulting Buffer after serialization.

    • Reads a signed or unsigned integer of specified size and endianness from a BytesIO stream.

      Parameters

      • data: BytesIO

        The BytesIO stream to read from.

      • signed: boolean = true

        Whether the integer should be interpreted as signed. Defaults to true.

      • little: boolean = true

        Whether to use little-endian byte order. Defaults to true.

      • size: number = Int128.SIZE

        The number of bytes to read. Defaults to Int128.SIZE.

      Returns Promise<bigint>

      A Promise that resolves to the read integer as a bigint.

    • Serializes a 128-bit integer (bigint) value into a Buffer.

      Parameters

      • value: bigint

        The 128-bit integer value to serialize.

      • _signed: boolean = true

        Indicates whether the integer is signed. Defaults to true.

      • _little: boolean = true

        Indicates whether to use little-endian byte order. Defaults to true.

      Returns Buffer

      A Buffer containing the serialized bytes of the integer.