BufferedOutputStream.java (write(int)): Only flush when next byte cannot be buffered.

* java/io/BufferedOutputStream.java (write(int)): Only flush when
       next byte cannot be buffered.

From-SVN: r62867
This commit is contained in:
Mark Wielaard 2003-02-13 22:48:36 +00:00 committed by Mark Wielaard
parent 1bc8b0ad4e
commit 8ad2b7a27b
2 changed files with 9 additions and 4 deletions

View file

@ -1,5 +1,5 @@
/* BufferedOutputStream.java -- Buffer output into large blocks before writing
Copyright (C) 1998, 2000 Free Software Foundation, Inc.
Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@ -189,11 +189,11 @@ finalize() throws IOException
public synchronized void
write(int b) throws IOException
{
buf[count] = (byte)(b & 0xFF);
++count;
if (count == buf.length)
flush();
buf[count] = (byte)(b & 0xFF);
++count;
}
/*************************************************************************/