JAL-1705 - allow a FileParse to be constructed directly from a reader for direct...
authorJim Procter <jprocter@issues.jalview.org>
Fri, 26 Jun 2015 16:21:58 +0000 (17:21 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 26 Jun 2015 16:21:58 +0000 (17:21 +0100)
src/jalview/io/FileParse.java

index 9228257..2221312 100755 (executable)
@@ -269,6 +269,30 @@ public class FileParse
   }
 
   /**
+   * not for general use, creates a fileParse object for an existing reader with
+   * configurable values for the origin and the type of the source
+   */
+  public FileParse(BufferedReader source, String originString,
+          String typeString)
+  {
+    type = typeString;
+    error = false;
+    inFile = null;
+    dataName = originString;
+    dataIn = source;
+    try
+    {
+      if (dataIn.markSupported())
+      {
+        dataIn.mark(READAHEAD_LIMIT);
+      }
+    } catch (IOException q)
+    {
+
+    }
+  }
+
+  /**
    * Create a datasource for input to Jalview. See AppletFormatAdapter for the
    * types of sources that are handled.
    *