napi_get_dataview_info


napi_status napi_get_dataview_info(napi_env env,
                                   napi_value dataview,
                                   size_t* byte_length,
                                   void** data,
                                   napi_value* arraybuffer,
                                   size_t* byte_offset) 
  • [in] env:调用 API 的环境。

    ¥[in] env: The environment that the API is invoked under.

  • [in] dataviewnapi_value 表示要查询其属性的 DataView

    ¥[in] dataview: napi_value representing the DataView whose properties to query.

  • [out] byte_lengthDataView 中的字节数。

    ¥[out] byte_length: Number of bytes in the DataView.

  • [out] dataDataView 下的数据缓冲区。如果 byte_length 是 0,则这可能是 NULL 或任何其他指针值。

    ¥[out] data: The data buffer underlying the DataView. If byte_length is 0, this may be NULL or any other pointer value.

  • [out] arraybufferArrayBufferDataView 的基础。

    ¥[out] arraybuffer: ArrayBuffer underlying the DataView.

  • [out] byte_offset:开始投影 DataView 的数据缓冲区中的字节偏移量。

    ¥[out] byte_offset: The byte offset within the data buffer from which to start projecting the DataView.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.

如果不需要该属性,则任何输出参数都可以是 NULL

¥Any of the out parameters may be NULL if that property is unneeded.

此 API 返回 DataView 的各种属性。

¥This API returns various properties of a DataView.