如何在资源/原材料宣布写入文件?原材料、文件、如何在、资源

2023-09-04 04:14:16 作者:[ 柠萌 ]

我有存储在RES /原始的文件,我想知道如何WITE到该文件中。 我想getResources但它返回一个InputStream。

I have a file stored in res/raw, and I would like to know how to wite into that file. I tried getResources but it returns an inputStream.

推荐答案

不可能的。如果您需要将资产复制到设备上存储的文件中的资产目录。然后使用AssetManager流中,并复制资产,所以你可以把它写到光盘或应用程序缓存。

Not possible. If you need to copy an asset to the device store the file in the assets directory. Then use the AssetManager to stream in and copy the asset so you can write it to disc or application cache.