当前位置:网站首页>鸿蒙读取资源文件
鸿蒙读取资源文件
2022-06-23 08:07:00 【helwens】
在鸿蒙读取外部资源文件的API为getRawFile
但是这个方法的使用有些蹊跷
按照官方文档:
文档中心
https://developer.harmonyos.com/cn/docs/documentation/doc-guides/basic-resource-file-example-0000001051733014#section126348226453首先把外部资源文件存放在resource/rawfile内
读取时只需要
this.getResourceManager().getRawFileEntry("resources/rawfile/models");
即可读取,这个resources/rawfile不能去掉,必须保留才能读取得到
有一次在使用
this.getResourceManager().getRawFileEntry("models");无法读取文件,原因就在这里
然而还有一种情况,就是到了后面openrawfile就会出错
this.getResourceManager().getRawFileEntry("resources/rawfile/labels/labelmap”).openRawFile()会直接报错
java.io.FileNotFoundException: resources/rawfile/labels/labelmap
此时要改成“entry/resources/rawfile/labels/labelmap” 加上entry就不会报错
所以保险一点还是要有entry
边栏推荐
- odoo项目 发送信息到微信公众号或企业微信的做法
- 【论文笔记】Catching Both Gray and Black Swans: Open-set Supervised Anomaly Detection*
- Location of firewalld configuration file
- openvino系列 18. 通过OpenVINO和OpenCV实现实时的物体识别(RTSP,USB视频读取以及视频文件读取)
- Markdown学习
- Configuration asmx not accessible
- Commonly used bypass methods for SQL injection -ctf
- 力扣(LeetCode)173. 二叉搜索树迭代器(2022.06.22)
- After reading five books, I summarized these theories of wealth freedom
- Generate code 39 extension code in batch through Excel file
猜你喜欢

Vulnhub | DC: 4 |【实战】

Basic use of check boxes and implementation of select all and invert selection functions
![[paper notes] catching both gray and black swans: open set supervised analog detection*](/img/52/787b25a9818cfc6a1897af81d41ab2.png)
[paper notes] catching both gray and black swans: open set supervised analog detection*

Deep learning ----- different methods to realize vgg16
![Vulnhub | DC: 4 | [combat]](/img/33/b7422bdb18f39e9eb55855dbf1d584.png)
Vulnhub | DC: 4 | [combat]

实战监听Eureka client的缓存更新

谈谈 @Autowired 的实现原理

Image segmentation - improved network structure

Socket programming (multi process)

目标检测中的多尺度特征结合方式
随机推荐
ArcLayoutView: 一个弧形布局的实现
【论文笔记】Catching Both Gray and Black Swans: Open-set Supervised Anomaly Detection*
Huawei ECS EIP cannot be pinged
Ad object of Active Directory
How to migrate x86 architecture applications to arm architecture at low cost
APM performance monitoring practice of jubasha app
开源软件、自由软件、Copyleft、CC都是啥,傻傻分不清楚?
Deep learning ----- different methods to implement lenet-5 model
渲染效果图哪家好?2022最新实测(四)
Create an orderly sequence table and perform the following operations: 1 Insert element x into the table and keep it in order; 2. find the element with the value of X, and delete it if found; 3. outpu
Go language basic conditional statement if
C print zoom
Multi Chain and cross chain are the future
你有一串代码,但是不支持低版本Go时;判断Go版本号,您值得拥有!
transform的结构及用法
81 sentences worth repeating
Imperva- method of finding regular match timeout
aquatone工具 中的2个bug修复
论文阅读【Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset】
“方脸老师”董宇辉再回应热度下降:把农产品直播做好让农民受益 考虑去支教