------- Additional Comments From tromey at gcc dot gnu dot org  2004-11-09 
22:11 -------
I downloaded the test case and modified it to print the
number of characters it read.  I can confirm that for me it
does in fact loop:

opsy. gij TestGcj.IoTest ../demo/buildlog.txt  Out.txt
fileLength = 2290
x = 2048
x = 242

A few things to note here.

First, you're using a BufferedReader, so you aren't guaranteed
to fill your request array.  You might pick up buffered data instead.

Second, using characters here is incorrect, as File.length() returns
the size in bytes.  This seems to be the cause of the problem we're
seeing with the test case, since it still operates in the same way
if I remove the buffering.  I think the internal character set converters
have their own buffers and as a result we don't get a full file read.

If I change the loop in this test program to use the actual read result
as the length argument to write, it works properly.  So, even though libgcj
is perhaps a little odd here, I still think it is correct.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18376

Reply via email to