@tgsnake/skema
    Preparing search index...

    Class GzipPacked

    GzipPacked is a class representing a Telegram MTProto object that is packed using gzip compression. It provides methods to read and write this packed data 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.

    packedData: TLObject
    subclassOfId: number

    Identifier for the parent class (if any).

    ID: number = 0x3072cfa1

    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 current instance into a Buffer using Gzip compression.

      This method performs the following steps:

      1. Writes the class identifier using a primitive integer writer.
      2. Compresses the packed data using Gzip and writes it as bytes.
      3. Returns the resulting data as a Node.js Buffer.

      Returns Buffer

      The serialized and Gzip-compressed representation of the instance.

    • Reads and decompresses Gzip-packed data from the provided BytesIO stream.

      This static method overrides the base implementation to:

      1. Read raw bytes from the input stream using Primitive.Bytes.read.
      2. Decompress the bytes using gunzipSync.
      3. Wrap the decompressed bytes in a new BytesIO instance.
      4. Parse the decompressed data as a TLObject.
      5. Cast and return the result as a GzipPacked instance.

      Parameters

      • data: BytesIO

        The BytesIO stream containing the Gzip-packed data.

      • ..._args: any[]

        Additional arguments (unused).

      Returns Promise<GzipPacked>

      A Promise that resolves to a GzipPacked instance.

    • Serializes the provided arguments into a Buffer.

      Parameters

      • ..._args: any[]

        The arguments to be serialized.

      Returns Buffer

      A Buffer containing the serialized data.

      This is a static method. The current implementation returns an empty Buffer.