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] dataview:napi_value表示要查询其属性的DataView。¥
[in] dataview:napi_valuerepresenting theDataViewwhose properties to query. -
[out] byte_length:DataView中的字节数。¥
[out] byte_length: Number of bytes in theDataView. -
[out] data:DataView下的数据缓冲区。如果 byte_length 是0,则这可能是NULL或任何其他指针值。¥
[out] data: The data buffer underlying theDataView. If byte_length is0, this may beNULLor any other pointer value. -
[out] arraybuffer:ArrayBuffer是DataView的基础。¥
[out] arraybuffer:ArrayBufferunderlying theDataView. -
[out] byte_offset:开始投影DataView的数据缓冲区中的字节偏移量。¥
[out] byte_offset: The byte offset within the data buffer from which to start projecting theDataView.
如果 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.