Refactoring of all SequenceAnnotation web services
[jabaws.git] / datamodel / compbio / data / sequence / FastaReader.java
index 2e1357f..38f1ccb 100644 (file)
@@ -19,6 +19,7 @@ package compbio.data.sequence;
 \r
 import java.io.File;\r
 import java.io.FileNotFoundException;\r
+import java.io.InputStream;\r
 import java.util.Iterator;\r
 import java.util.Scanner;\r
 \r
@@ -92,6 +93,19 @@ public class FastaReader implements Iterator<FastaSequence> {
                        }\r
                });\r
        }\r
+\r
+       /**\r
+        * This class will not close the incoming stream! So the client should do\r
+        * so.\r
+        * \r
+        * @param inputStream\r
+        * @throws FileNotFoundException\r
+        */\r
+       public FastaReader(final InputStream inputStream)\r
+                       throws FileNotFoundException {\r
+               input = new Scanner(inputStream);\r
+               input.useDelimiter("\\s*>");\r
+       }\r
        /**\r
         * {@inheritDoc}\r
         * \r