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_value
representing theDataView
whose 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 beNULL
or any other pointer value. -
[out] arraybuffer
:ArrayBuffer
是DataView
的基础。¥
[out] arraybuffer
:ArrayBuffer
underlying 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
.