Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想FileChannel从AssetManagerAndroid中获得一个,有什么办法吗?我想将一些原始的自定义二进制文件映射到一些缓冲区。(如果您有比使用 更好的解决方案AssetManager,请随时提及。
FileChannel
AssetManager
弄清楚了:
FileChannel fc = manager.openFd(file).createInputStream().getChannel();
不确定它是否有效。我会确认是否有。
编辑:
这仅在文件未压缩时才有效。您必须使用正确的文件扩展名或在 aapt 上添加 -0 标志。寻找如何在日食上做到这一点......