【发布时间】:2011-05-12 20:06:13
【问题描述】:
我看到很多这样的例子:
String FILENAME = "hello_file";
String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
但不是如何从内部应用程序文件中读回它们。大多数示例都假定特定的字符串长度来计算字节缓冲区,但我不知道长度是多少。有没有简单的方法可以做到这一点?我的应用最多可向文件写入 50-100 个字符串
【问题讨论】: