remember to put newlines in the log
[org.ibex.io.git] / src / org / ibex / io / Stream.java
index 19363b0..558e0ca 100644 (file)
@@ -38,6 +38,17 @@ public class Stream {
         } catch (IOException ioe) { throw new StreamException(ioe); }
     }
 
+    public void transcribe(StringBuffer out) {
+        //try {
+            char[] buf = new char[1024];
+            while(true) {
+                int numread = in.read(buf, 0, buf.length);
+                if (numread==-1) return;
+                out.append(buf, 0, numread);
+            }
+            //} catch (IOException ioe) { throw new StreamException(ioe); }
+    }
+
     public static int countLines(Stream s) {
         int ret = 0;
         while(s.readln() != null) ret++;
@@ -114,6 +125,7 @@ public class Stream {
         try {
             blocker.put(Thread.currentThread(), this);
             logWrite(s);
+            logWrite(newLine);
             out.write(s);
             out.write(newLine);
             flush();