[multiple changes]
[gcc.git] / libjava / javax / imageio / stream / MemoryCacheImageInputStream.java
index c7ca6d6e06d0ce7cdafc95c0f5a8727659bbc984..3631e64fc205767fffe711d8eca5912b00c36b92 100644 (file)
@@ -38,11 +38,35 @@ exception statement from your version. */
 
 package javax.imageio.stream;
 
+import java.io.IOException;
+import java.io.InputStream;
+
 /**
  * @author Michael Koch (konqueror@gmx.de)
  */
-public class MemoryCacheImageInputStream
+public class MemoryCacheImageInputStream extends ImageInputStreamImpl
 {
+  private InputStream stream;
+  
+  public MemoryCacheImageInputStream(InputStream stream)
+  {
+    this.stream = stream;
+  }
+
+  public void close()
+    throws IOException
+  {
+    super.close();
+    stream.close();
+  }
+
+  public void flushBefore(long position)
+    throws IOException
+  {
+    // FIXME: Implement me.
+    throw new Error("not implemented");
+  }
+
   public boolean isCached()
   {
     return true;
@@ -57,4 +81,18 @@ public class MemoryCacheImageInputStream
   {
     return true;
   }
+
+  public int read()
+    throws IOException
+  {
+    setBitOffset(0);
+    return stream.read();
+  }
+
+  public int read(byte[] data, int offset, int len)
+    throws IOException
+  {
+    setBitOffset(0);
+    return stream.read(data, offset, len);
+  }
 }