181607e2ee10480dc84501a4406c1ad90da7f330
[org.ibex.core.git] / src / org / xwt / util / KnownLength.java
1 // Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
2 package org.xwt.util;
3 import java.io.*;
4
5 /** a generic interface for things that "know" their length */
6 public interface KnownLength {
7
8     public abstract int getLength();
9
10     public static class KnownLengthInputStream extends FilterInputStream implements KnownLength {
11         int length;
12         public int getLength() { return length; }
13         public KnownLengthInputStream(java.io.InputStream parent, int length) {
14             super(parent);
15             this.length = length;
16         }
17     }
18
19 }