+ private Stream in_next = null;
+
+ public Stream appendStream(Stream in_next) {
+ if (this.in_next != null) return this.in_next.appendStream(in_next);
+ this.in_next = in_next;
+ return this;
+ }
+
+ public static boolean loggingEnabled = "true".equals(System.getProperty("ibex.io.stream.logEnabled", "false"));
+
+ public void transcribe(Stream out) { transcribe(out, false); }
+ public void transcribe(Stream out, boolean close) {
+ try {
+ byte[] buf = new byte[1024];
+ while(true) {
+ int numread = in.read(buf, 0, buf.length);
+ if (numread==-1) break;
+ out.out.write(buf, 0, numread);
+ }
+ if (close) out.close();
+ } 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); }
+ }