The check to see if the buffer needs to be grown was using the length of
the buffer to be copied from, instead of the buffer being copied to.

Index: ByteArrayOutputStream.java
===================================================================
RCS file: /cvs/classpath/java/io/ByteArrayOutputStream.java,v
retrieving revision 1.6
diff -u -r1.6 ByteArrayOutputStream.java
--- ByteArrayOutputStream.java  2000/03/16 19:21:03     1.6
+++ ByteArrayOutputStream.java  2000/08/15 17:03:54
@@ -333,7 +333,7 @@
 
   if ((len % buffer_increment_size) != 0)
     {
-      if ((buf.length - count) < (len % buffer_increment_size))
+      if ((this.buf.length - count) < (len % buffer_increment_size))
         enlargeBuffer();
 
       System.arraycopy(buf, offset + (i * buffer_increment_size), this.buf,

Reply via email to