Skip to Content
0
Former Member
Jan 18, 2008 at 08:02 AM

java.lang.OutOfMemoryError when reading file ~ 50MB

10 Views

Hi everybody,

I get java.lang.OutOfMemoryError when reading a very huge file:

DataInputStream in = new DataInputStream(fstream);

BufferedReader br = new BufferedReader(new InputStreamReader(in));

String strLine;

// the following thows the error

while ((strLine = br.readLine()) != null) {

How can I read huge files?

Thanks regards

Mario