code cleanup, fix for ReplaceInputStream
[nikiroo-utils.git] / src / be / nikiroo / utils / streams / MarkableFileInputStream.java
index dab4cdc45a536f993f8e6924d89ef4fdd5780e32..7622b24f5af52e6234f446f88b0500d88f31eb3f 100644 (file)
@@ -1,6 +1,8 @@
 package be.nikiroo.utils.streams;
 
+import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.FilterInputStream;
 import java.io.IOException;
 import java.nio.channels.FileChannel;
@@ -15,6 +17,19 @@ public class MarkableFileInputStream extends FilterInputStream {
        private FileChannel channel;
        private long mark = 0;
 
+       /**
+        * Create a new {@link MarkableFileInputStream} from this file.
+        * 
+        * @param file
+        *            the {@link File} to wrap
+        * 
+        * @throws FileNotFoundException
+        *             if the {@link File} cannot be found
+        */
+       public MarkableFileInputStream(File file) throws FileNotFoundException {
+               this(new FileInputStream(file));
+       }
+
        /**
         * Create a new {@link MarkableFileInputStream} from this stream.
         *