2003/10/25 07:50:20
[org.ibex.core.git] / src / org / xwt / HTTP.java
index 2980ed5..3bd0a6b 100644 (file)
@@ -498,7 +498,7 @@ public class HTTP {
     // HTTPInputStream ///////////////////////////////////////////////////////////////////////////////////
 
     /** An input stream that represents a subset of a longer input stream. Supports HTTP chunking as well */
-    public class HTTPInputStream extends FilterInputStream {
+    public class HTTPInputStream extends FilterInputStream implements KnownLength {
 
         /** if chunking, the number of bytes remaining in this subset; otherwise the remainder of the chunk */
         private int length = 0;
@@ -523,6 +523,7 @@ public class HTTP {
             this.length = length == -1 ? 0 : length;
         }
 
+        public int getLength() { return contentLength; }
         public boolean markSupported() { return false; }
         public int read(byte[] b) throws IOException { return read(b, 0, b.length); }
         public long skip(long n) throws IOException { return read(null, -1, (int)n); }