partial update of core for new js stuff
[org.ibex.core.git] / src / org / ibex / core / Stream.java
index 60afa46..34b71d5 100644 (file)
@@ -1,4 +1,7 @@
-// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the GNU General Public License version 2 ("the License").
+// You may not use this file except in compliance with the License.
+
 package org.ibex.core;
 
 import java.io.*;
@@ -14,7 +17,7 @@ import org.ibex.net.*;
  *   be totally independent of the others (ie separate stream position
  *   and state) although they draw from the same data source.
  */
-public abstract class Stream extends JS.O implements JS.Cloneable {
+public abstract class Stream extends JS.Obj implements JS.Cloneable {
 
     // Public Interface //////////////////////////////////////////////////////////////////////////////
 
@@ -109,6 +112,14 @@ public abstract class Stream extends JS.O implements JS.Cloneable {
         public InputStream getInputStream() throws IOException { return Platform.getBuiltinInputStream(); }
     }
 
+    /** the Builtin resource */
+    public static class FromInputStream extends Stream {
+        private final InputStream is;
+        public FromInputStream(InputStream is) { this.is = is; }
+        public String getCacheKey() throws NotCacheableException { throw new NotCacheableException(); }
+        public InputStream getInputStream() throws IOException { return is; }
+    }
+
     /** shadow resource which replaces the graft */
     public static class ProgressWatcher extends Stream {
         final Stream watchee;