You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2001/07/12 08:23:22 UTC

cvs commit: xml-cocoon2/src/org/apache/cocoon/caching CachingOutputStream.java

cziegeler    01/07/11 23:23:22

  Modified:    src/org/apache/cocoon/caching CachingOutputStream.java
  Log:
  Fixed calculation of byte array length
  
  Revision  Changes    Path
  1.3       +3 -3      xml-cocoon2/src/org/apache/cocoon/caching/CachingOutputStream.java
  
  Index: CachingOutputStream.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/caching/CachingOutputStream.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CachingOutputStream.java	2001/05/14 11:43:07	1.2
  +++ CachingOutputStream.java	2001/07/12 06:23:19	1.3
  @@ -16,7 +16,7 @@
    * TeeOutputStream.
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/05/14 11:43:07 $
  + * @version CVS $Revision: 1.3 $ $Date: 2001/07/12 06:23:19 $
    */
   
   public final class CachingOutputStream
  @@ -61,7 +61,7 @@
       public void write(byte b[], int off, int len) throws IOException {
           this.receiver.write(b, off, len);
           if (len == 0) return;
  -        int newcount = this.bufCount + len;
  +        int newcount = this.bufCount + (len-off);
           if (newcount > this.buf.length) {
               byte newbuf[] = new byte[Math.max(this.buf.length << 1, newcount)];
               System.arraycopy(this.buf, 0, newbuf, 0, this.bufCount);
  @@ -80,4 +80,4 @@
       }
   
   
  -}
  \ No newline at end of file
  +}
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org