JAL-1784 refactor parse method to directly parse FileParser input reader stream.
[jalview.git] / src / jalview / io / HtmlFile.java
index 73aa5d2..e847c58 100644 (file)
@@ -22,6 +22,7 @@
 package jalview.io;
 
 import java.io.IOException;
+import java.io.StringReader;
 
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -75,9 +76,7 @@ public class HtmlFile extends AlignFile implements ComplexAlignFile
 
       Document doc = Jsoup.parse(htmlData.toString());
       Element content = doc.getElementById("seqData");
-      String alignmentJsonString = content.val();
-
-      JSONFile jsonFile = new JSONFile().parse(alignmentJsonString);
+      JSONFile jsonFile = new JSONFile().parse(new StringReader(content.val()));
       this.seqs = jsonFile.getSeqs();
       this.seqGroups = jsonFile.getSeqGroups();
       this.annotations = jsonFile.getAnnotations();