napi_get_buffer_info

Function napi_get_buffer_info 

Source
pub unsafe extern "C" fn napi_get_buffer_info(
    env: napi_env,
    value: napi_value,
    data: *mut *mut c_void,
    length: *mut usize,
) -> napi_status
Available on crate feature napi only.
Expand description

Obtains the underlying data of ‘ArrayBuffer’ and its length.

§Arguments

  • env - Current running virtual machine context.

  • value - ArkTS ArrayBuffer object.

  • data - Raw pointer to the underlying arraybuffer.

  • length - Bytes size of the underlying arraybuffer.

§Returns

  • Returns the function execution status. [napi_ok] If the function executed successfully.

[napi_invalid_arg] If env, value or result is nullptr.

[napi_arraybuffer_expected] If the ‘value’ is not an ArkTS array buffer object.

Available since API-level: 10