Author: nextgens
Date: 2008-08-25 21:51:59 +0000 (Mon, 25 Aug 2008)
New Revision: 22156
Modified:
trunk/freenet/src/freenet/support/io/TempBucketFactory.java
Log:
TempBucket: fix mark() and reset() ... hopefully it will throw if it's not
implemented
Modified: trunk/freenet/src/freenet/support/io/TempBucketFactory.java
===================================================================
--- trunk/freenet/src/freenet/support/io/TempBucketFactory.java 2008-08-25
21:47:40 UTC (rev 22155)
+++ trunk/freenet/src/freenet/support/io/TempBucketFactory.java 2008-08-25
21:51:59 UTC (rev 22156)
@@ -209,6 +209,7 @@
private class TempBucketInputStream extends InputStream {
private InputStream currentIS;
private long index = 0;
+ private long mark = 0;
private void _maybeResetInputStream() throws
IOException {
if(shouldResetIS) {
@@ -273,6 +274,7 @@
Logger.error(this,
"IOE:"+e.getMessage(),e);
}
currentIS.mark(readlimit);
+ mark = index;
}
}
@@ -281,7 +283,8 @@
synchronized(currentBucket) {
_maybeResetInputStream();
currentIS.reset();
- }
+ index = mark;
+ }
}
@Override