abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r452232 - /incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/io/RewindableInputStream.java
Date Mon, 02 Oct 2006 21:44:57 GMT
Author: jmsnell
Date: Mon Oct  2 14:44:56 2006
New Revision: 452232

URL: http://svn.apache.org/viewvc?view=rev&rev=452232
Log:
Silly bug

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/io/RewindableInputStream.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/io/RewindableInputStream.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/io/RewindableInputStream.java?view=diff&rev=452232&r1=452231&r2=452232
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/io/RewindableInputStream.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/io/RewindableInputStream.java
Mon Oct  2 14:44:56 2006
@@ -44,6 +44,10 @@
     this.scale = capacity;
   }
 
+  public int position() {
+    return position;
+  }
+  
   private void grow(int capacity)  {
     if (buffer == null) {
       buffer = new byte[capacity];
@@ -95,7 +99,8 @@
     int r = super.read(b, off, len);
     if (r != -1) {
       if (position + r >= buffer.length) grow(Math.max(position+r,scale));
-      System.arraycopy(b, off, buffer, position++, r);
+      System.arraycopy(b, off, buffer, position, r);
+      position = position + r;
     }
     return r;
   }



Mime
View raw message