Anna Chou
September 23rd, 1999, 09:07 PM
I need a file viewer.
Following is partial code.
Everything is ok if the file is NOT too big.
If a file is big such as one of my test case, length = 185191, the TextArea is empty.
This is happening on win95. No problem in winnt.
I feel this is a JAVA bug.(?) But I need a work around.
Please help. Thanks you very much.
===============================================
File f = new File(file_name);
BufferedReader br =
new BufferedReader(new FileReader(f));
long size = f.length();
System.out.println( " f.length=" + size );
int sz = (int) size;
char[] cbuf = new char[sz];
int n = br.read( cbuf, 0, sz );
TextArea ta= new TextArea( new String(cbuf), 24, 20);
......
Anna Chou
Following is partial code.
Everything is ok if the file is NOT too big.
If a file is big such as one of my test case, length = 185191, the TextArea is empty.
This is happening on win95. No problem in winnt.
I feel this is a JAVA bug.(?) But I need a work around.
Please help. Thanks you very much.
===============================================
File f = new File(file_name);
BufferedReader br =
new BufferedReader(new FileReader(f));
long size = f.length();
System.out.println( " f.length=" + size );
int sz = (int) size;
char[] cbuf = new char[sz];
int n = br.read( cbuf, 0, sz );
TextArea ta= new TextArea( new String(cbuf), 24, 20);
......
Anna Chou