added transcribe(StringBuffer)
authoradam <adam@megacz.com>
Wed, 23 Feb 2005 04:38:23 +0000 (04:38 +0000)
committeradam <adam@megacz.com>
Wed, 23 Feb 2005 04:38:23 +0000 (04:38 +0000)
darcs-hash:20050223043823-5007d-d0973db1c2c4b15d2fe33305651a4c15db9ab6ce.gz

src/org/ibex/io/Stream.java

index 19363b0..019a2f4 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++;