public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "wayne dot gray at coynetextileservices dot com" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug libgcj/18376] java.io.BufferedWriter outputing  extraneous characters?
Date: Tue, 09 Nov 2004 13:37:00 -0000	[thread overview]
Message-ID: <20041109133703.2446.qmail@sourceware.org> (raw)
In-Reply-To: <20041108145729.18376.wayne.gray@coynetextileservices.com>


------- Additional Comments From wayne dot gray at coynetextileservices dot com  2004-11-09 13:36 -------
(In reply to comment #3)
> 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.
> 

I see what you're saying.  But if that were true then the while loop would have
multiple iterations.  No?

The read and write methods are only being called once in this method for this
file.  Just confirmed with another test.

This is true because I'm sizing the buffer to the length of the file and... 

  br.read(charBuff,0,fileLength)

...reads the entire file length in the first shot.


-- 


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


  parent reply	other threads:[~2004-11-09 13:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-08 14:57 [Bug java/18376] New: " wayne dot gray at coynetextileservices dot com
2004-11-08 15:00 ` [Bug libgcj/18376] " pinskia at gcc dot gnu dot org
2004-11-08 15:02 ` wayne dot gray at coynetextileservices dot com
2004-11-08 18:34 ` pinskia at gcc dot gnu dot org
2004-11-08 22:17 ` tromey at gcc dot gnu dot org
2004-11-09 13:37 ` wayne dot gray at coynetextileservices dot com [this message]
2004-11-09 22:11 ` tromey at gcc dot gnu dot org
2004-11-10 18:23 ` wayne dot gray at coynetextileservices dot com
2005-04-28 21:52 ` pinskia at gcc dot gnu dot org
2005-04-28 22:38 ` greenrd at greenrd dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041109133703.2446.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).