X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fibex%2Futil%2FKnownLength.java;fp=src%2Forg%2Fibex%2Futil%2FKnownLength.java;h=06118bb40e870e0021496cf331fc1bd0ad3d0000;hb=3591b88b94a6bb378af3d4abe6eb5233ce583104;hp=0000000000000000000000000000000000000000;hpb=de378041d5ca2aca1a2b5a31ef15ae90a86c977f;p=org.ibex.core.git diff --git a/src/org/ibex/util/KnownLength.java b/src/org/ibex/util/KnownLength.java new file mode 100644 index 0000000..06118bb --- /dev/null +++ b/src/org/ibex/util/KnownLength.java @@ -0,0 +1,25 @@ +// Copyright (C) 2003 Adam Megacz all rights reserved. +// +// You may modify, copy, and redistribute this code under the terms of +// the GNU Library Public License version 2.1, with the exception of +// the portion of clause 6a after the semicolon (aka the "obnoxious +// relink clause") + +package org.ibex.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; + } + } + +}