@tgsnake/skema
    Preparing search index...

    Class Float

    Float is a class representing a single-precision floating-point number in the Telegram MTProto protocol. It provides methods to read and write these numbers in a specified format.

    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).

    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 32-bit floating point number from the provided BytesIO stream.

      Parameters

      • data: BytesIO

        The BytesIO instance to read from.

      • little: boolean = true

        If true, reads the float in little-endian order; otherwise, reads in big-endian order. Defaults to true.

      Returns Promise<number>

      A promise that resolves to the read floating point number.

    • Serializes a 32-bit floating point number into a Buffer.

      Parameters

      • value: number

        The number to serialize.

      • little: boolean = true

        If true, writes the number in little-endian format; otherwise, in big-endian format. Defaults to true.

      Returns Buffer

      A Buffer containing the serialized float.