0
Context IO API(openFileInput和openFileOutput)与Context.getFilesDir上使用Java的IO API有什么不同?Context.openFileInput()与使用Java.IO类的区别
Context IO API(openFileInput和openFileOutput)与Context.getFilesDir上使用Java的IO API有什么不同?Context.openFileInput()与使用Java.IO类的区别
没什么。例如,这里是openFileInput()
from ContextImpl
(基实现的Context
)执行:
@Override
public FileInputStream openFileInput(String name)
throws FileNotFoundException {
File f = makeFilename(getFilesDir(), name);
return new FileInputStream(f);
}
其中makeFilename()
有你叫喊,如果你有在文件名的目录分隔符。
个人而言,我使用getFilesDir()
,因为它更灵活。
当你为此搜索时发生了什么? :) – 2014-10-03 00:37:31