This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/18376] java.io.BufferedWriter outputing extraneous characters?


------- Additional Comments From tromey at gcc dot gnu dot org  2004-11-08 22:17 -------
The code says:

  while (br.read(charBuff,0,fileLength) != -1) 
    bw.write(charBuff,0,fileLength); 

There is no guarantee that read() will fill the buffer.
If you see a partial read, you will then write a full buffer,
meaning that the remainder of the buffer will be zero
(or leftovers from an earlier read).

So, I think this is not a libgcj bug.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]