stringbuffer vs charsequence android

时间:2012-03-30 11:56:40

标签: java android out-of-memory charsequence

我想知道如何在使用charsequence读取后将其放入stringbuffer中?

这是我的代码:

StringBuffer data=new StringBuffer();

File f= new File(Environment.getExternalSTorageDirector+"/file.pdf");
FileInputStream fileIS= new FileInputStream(f);
BufferReader buf= new BufferReader(new InputSreamReader(fileIS));
String readString = new String();
while((readString = buf.readLine())!=null)
{data.append(readString);
}

文件是10MB

这样做我有错误:OutOfMemory

0 个答案:

没有答案