Merge branch 'subtree'
[fanfix.git] / src / be / nikiroo / utils / MarkableFileInputStream.java
index f4d95d53bf73d6326e2fbabcf7a0a656f40c75fa..3f280641a4ed941ae9e9a29129852d531dd5ef6f 100644 (file)
@@ -1,51 +1,22 @@
 package be.nikiroo.utils;
 
+import java.io.File;
 import java.io.FileInputStream;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.nio.channels.FileChannel;
+import java.io.FileNotFoundException;
 
 /**
- * This is a markable (and thus reset-able) stream that you can create from a
- * FileInputStream.
+ * Class was moved to {@link be.nikiroo.utils.streams.MarkableFileInputStream}.
  * 
  * @author niki
  */
-public class MarkableFileInputStream extends FilterInputStream {
-       private FileChannel channel;
-       private long mark = 0;
-
-       /**
-        * Create a new {@link MarkableFileInputStream} from this stream.
-        * 
-        * @param in
-        *            the original {@link FileInputStream} to wrap
-        */
-       public MarkableFileInputStream(FileInputStream in) {
-               super(in);
-               channel = in.getChannel();
-       }
-
-       @Override
-       public boolean markSupported() {
-               return true;
-       }
-
-       @Override
-       public synchronized void mark(int readlimit) {
-               try {
-                       mark = channel.position();
-               } catch (IOException ex) {
-                       ex.printStackTrace();
-                       mark = -1;
-               }
+@Deprecated
+public class MarkableFileInputStream extends
+               be.nikiroo.utils.streams.MarkableFileInputStream {
+       public MarkableFileInputStream(File file) throws FileNotFoundException {
+               super(file);
        }
 
-       @Override
-       public synchronized void reset() throws IOException {
-               if (mark < 0) {
-                       throw new IOException("mark position not valid");
-               }
-               channel.position(mark);
+       public MarkableFileInputStream(FileInputStream fis) {
+               super(fis);
        }
-}
\ No newline at end of file
+}