commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r501759 - /jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/MonitorInputStream.java
Date Wed, 31 Jan 2007 08:07:58 GMT
Author: imario
Date: Wed Jan 31 00:07:57 2007
New Revision: 501759

URL: http://svn.apache.org/viewvc?view=rev&rev=501759
Log:
overridden available() to match with MonitorInputStreams autoclosing capability.

Modified:
    jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/MonitorInputStream.java

Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/MonitorInputStream.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/MonitorInputStream.java?view=diff&rev=501759&r1=501758&r2=501759
==============================================================================
--- jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/MonitorInputStream.java
(original)
+++ jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/MonitorInputStream.java
Wed Jan 31 00:07:57 2007
@@ -38,7 +38,21 @@
         count = 0;
     }
 
-    /**
+
+	/**
+	 * Returns 0 if the stream is at eof, else the underlaying inputStream will be queried
+	 */
+	public synchronized int available() throws IOException
+	{
+		if (finished)
+		{
+			return 0;
+		}
+
+		return super.available();
+	}
+
+	/**
      * Reads a character.
      */
     public int read() throws IOException



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message