Author: nextgens
Date: 2008-08-26 08:34:14 +0000 (Tue, 26 Aug 2008)
New Revision: 22169

Modified:
   trunk/freenet/src/freenet/support/io/TempBucketFactory.java
Log:
TempBucket: doh

Modified: trunk/freenet/src/freenet/support/io/TempBucketFactory.java
===================================================================
--- trunk/freenet/src/freenet/support/io/TempBucketFactory.java 2008-08-26 
08:02:08 UTC (rev 22168)
+++ trunk/freenet/src/freenet/support/io/TempBucketFactory.java 2008-08-26 
08:34:14 UTC (rev 22169)
@@ -87,7 +87,6 @@
                                if(!isRAMBucket())
                                        // Nothing to migrate! We don't want to 
switch back to ram, do we?                                      
                                        return;
-
                                toMigrate = currentBucket;
                                Bucket tempFB = _makeFileBucket();
                                if(os != null) {
@@ -233,7 +232,7 @@
                                synchronized(TempBucket.this) {
                                        _maybeResetInputStream();
                                        int toReturn = currentIS.read();
-                                       if(toReturn > -1)
+                                       if(toReturn != -1)
                                                index++;
                                        return toReturn;
                                }
@@ -252,7 +251,7 @@
                                        _maybeResetInputStream();
                                        int toReturn = currentIS.read(b, off, 
len);
                                        if(toReturn > 0)
-                                               index += len;
+                                               index += toReturn;
                                        return toReturn;
                                }
                        }


Reply via email to