Readline instead of bit by bit
authoramwaterhouse <Andrew Waterhouse>
Thu, 27 Jul 2006 07:53:41 +0000 (07:53 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 27 Jul 2006 07:53:41 +0000 (07:53 +0000)
src/jalview/gui/Jalview2XML.java

index 84e3564..300cbd5 100755 (executable)
@@ -824,14 +824,15 @@ public class Jalview2XML
         }\r
         while (!entry.getName().equals(pdbId));\r
 \r
-        DataInputStream in = new DataInputStream(jin);\r
+        BufferedReader in = new BufferedReader(new InputStreamReader(jin));\r
         File outFile = File.createTempFile("jalview_pdb", ".txt");\r
         outFile.deleteOnExit();\r
-        DataOutputStream out = new DataOutputStream(new FileOutputStream(outFile));\r
-        int data;\r
-        while ( (data = in.read()) != -1)\r
+        PrintWriter out = new PrintWriter(new FileOutputStream(outFile));\r
+        String data;\r
+\r
+        while ( (data = in.readLine()) != null)\r
         {\r
-          out.write(data);\r
+          out.println(data);\r
         }\r
         out.close();\r
         return outFile.getAbsolutePath();\r