+// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
+package org.xwt.util;
+import java.io.*;
+
+/** a generic interface for things that "know" their length */
+public interface KnownLength {
+
+ public abstract int getLength();
+
+ public static class KnownLengthInputStream extends FilterInputStream implements KnownLength {
+ int length;
+ public int getLength() { return length; }
+ public KnownLengthInputStream(java.io.InputStream parent, int length) {
+ super(parent);
+ this.length = length;
+ }
+ }
+
+}