https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-resource-manager-V5\#getrawfilecontent9中说返回的是promise形式的Uint8Array数组,存放的是rawfile文件的内容,但是从下面的例程看出,返回值fileData是一个类或者是数据结构,因为可以对其中的变量fileData.buffer进行操作,那这个返回值中除了buffer外,还有什么其他内容呢?
let context = getContext(this);
let fileData = await context.resourceManager.getRawFileContent("A001.jpg");
let imageSource = image.createImageSource(fileData.buffer)
let pixelMapFile = await imageSource.createPixelMap({ editable: true, desiredPixelFormat: 3 })
https://developer.huawei.com/consumer/cn/doc/harmonyos-refere...\#getrawfilecontent9中说返回的是promise形式的Uint8Array数组,存放的是rawfile文件的内容,但是从下面的例程看出,返回值fileData是一个类或者是数据结构,因为可以对其中的变量fileData.buffer进行操作,那这个返回值中除了buffer外,还有什么其他内容呢?
返回值是一个Uint8Array对象,具体有啥成员可以看Uint8Array的定义。参考文档:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Refer...\_Objects/Uint8Array