more precise wrapping of I/O streams;
authorwenzelm
Fri, 26 Jun 2009 18:22:40 +0200
changeset 34621 6cba4b3723e4
parent 34620 5328c64f9866
child 34622 b1b88879c515
more precise wrapping of I/O streams;
src/Tools/jEdit/src/jedit/IsabelleEncoding.scala
--- a/src/Tools/jEdit/src/jedit/IsabelleEncoding.scala	Thu Jun 25 23:54:25 2009 +0200
+++ b/src/Tools/jEdit/src/jedit/IsabelleEncoding.scala	Fri Jun 26 18:22:40 2009 +0200
@@ -24,9 +24,7 @@
   {
     def source(): Source =
       BufferedSource.fromInputStream(in, decoder, BUFSIZE, { () => source() })
-    val text = Source.fromInputStream(in, Isabelle_System.charset).mkString
-    val buffer = Isabelle.symbols.decode(text).toArray
-		new CharArrayReader(buffer)
+    new CharArrayReader(Isabelle.symbols.decode(source.mkString).toArray)
   }
 
 	override def getTextReader(in: InputStream): Reader =
@@ -49,6 +47,7 @@
         out.write(text.getBytes(Isabelle_System.charset))
         out.flush()
       }
+      override def close() { out.close() }
     }
 		new OutputStreamWriter(buffer, charset.newEncoder())
   }