Uses JsonBin

构造函数

访问器

方法

构造函数

访问器

  • get instance(): JsonBinRead
  • 返回 JsonBinRead

    The singleton instance of the JsonBinRead class.

    Gets the singleton instance of the JsonBinRead class. If it doesn't exist, creates a new one.

    获取JsonBinRead类的单例实例。如果不存在,则创建一个新的实例。

方法

  • 参数

    • data: ArrayBuffer

      The ArrayBuffer containing the binary JSON data to be read.

    • 可选createObjWithClass: Function

      A function used to create objects with specific classes during the parsing process (optional).

    返回 any

    The parsed object. If the data format is not recognized, it returns null.

    Reads binary JSON data from the given ArrayBuffer and parses it into an object. It first initializes some internal state, determines the format based on a marker in the buffer, creates a keyMap for decoding, and then uses the _readOne method to start parsing the data. It also measures and may log the parsing time if it exceeds a certain threshold.

    从给定的ArrayBuffer中读取二进制JSON数据并将其解析为对象。 它首先初始化一些内部状态,根据缓冲区中的标记确定格式,创建用于解码的键映射,然后使用_readOne方法开始解析数据。如果解析时间超过一定阈值,它还会测量并可能记录解析时间。

  • 参数

    • data: ArrayBuffer

      The ArrayBuffer to be checked.

    返回 boolean

    True if the data is identified as JSONBin data, false otherwise.

    Checks if the given ArrayBuffer contains JSONBin data.

    检查给定的ArrayBuffer是否包含JsonBin数据。

  • 参数

    • value: ArrayBuffer

      The ArrayBuffer to be parsed.

    返回 any

    The parsed data as an object. If parsing fails, returns null.

    Parses the given ArrayBuffer as JSONBin data. If it's not in the expected JSONBin format, tries to parse it as a regular JSON string.

    将给定的ArrayBuffer解析为JsonBin数据。如果不是预期的JsonBin格式, 则尝试将其作为常规JSON字符串进行解析。