Author: nextgens Date: 2008-08-25 16:37:44 +0000 (Mon, 25 Aug 2008) New Revision: 22138
Modified:
trunk/freenet/src/freenet/support/io/TempBucketFactory.java
Log:
TempBucketFactory: really fix the issue with InputStreams; we need to
reimplement everything!
Modified: trunk/freenet/src/freenet/support/io/TempBucketFactory.java
===================================================================
--- trunk/freenet/src/freenet/support/io/TempBucketFactory.java 2008-08-25
16:31:57 UTC (rev 22137)
+++ trunk/freenet/src/freenet/support/io/TempBucketFactory.java 2008-08-25
16:37:44 UTC (rev 22138)
@@ -222,6 +222,54 @@
}
@Override
+ public long skip(long n) throws IOException {
+ synchronized(currentBucket) {
+ _maybeResetInputStream();
+ return is.skip(n);
+ }
+ }
+
+ @Override
+ public int available() throws IOException {
+ synchronized(currentBucket) {
+ _maybeResetInputStream();
+ return is.available();
+ }
+ }
+
+ @Override
+ public void mark(int readlimit) {
+ synchronized(currentBucket) {
+ try {
+ _maybeResetInputStream();
+ } catch (IOException e) {
+ Logger.error(this,
"IOE:"+e.getMessage(),e);
+ }
+ is.mark(readlimit);
+ }
+ }
+
+ @Override
+ public void reset() throws IOException {
+ synchronized(currentBucket) {
+ _maybeResetInputStream();
+ is.reset();
+ }
+ }
+
+ @Override
+ public boolean markSupported() {
+ synchronized(currentBucket) {
+ try {
+ _maybeResetInputStream();
+ } catch (IOException e) {
+ Logger.error(this,
"IOE:"+e.getMessage(),e);
+ }
+ return is.markSupported();
+ }
+ }
+
+ @Override
public final void close() throws IOException {
synchronized(currentBucket) {
_maybeResetInputStream();
