X-Git-Url: http://git.megacz.com/?p=org.ibex.io.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fio%2FStream.java;h=019a2f4a142086df3d1850ad87648a0684dd99bc;hp=19363b043f8c6244fd0f4f5dee24ccd178d4e00b;hb=ce302fede4773b90c042c0ca78fff8d28204f4a7;hpb=229e1d6333835aa449e9390a0175f0f89ce014b0 diff --git a/src/org/ibex/io/Stream.java b/src/org/ibex/io/Stream.java index 19363b0..019a2f4 100644 --- a/src/org/ibex/io/Stream.java +++ b/src/org/ibex/io/Stream.java @@ -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++;