projects
/
org.ibex.io.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hacks to support resin-based connections
[org.ibex.io.git]
/
src
/
org
/
ibex
/
io
/
Stream.java
diff --git
a/src/org/ibex/io/Stream.java
b/src/org/ibex/io/Stream.java
index
558e0ca
..
0d6c169
100644
(file)
--- a/
src/org/ibex/io/Stream.java
+++ b/
src/org/ibex/io/Stream.java
@@
-27,14
+27,16
@@
public class Stream {
public static boolean loggingEnabled = "true".equals(System.getProperty("ibex.io.stream.logEnabled", "false"));
public static boolean loggingEnabled = "true".equals(System.getProperty("ibex.io.stream.logEnabled", "false"));
- public void transcribe(Stream out) {
+ 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);
try {
byte[] buf = new byte[1024];
while(true) {
int numread = in.read(buf, 0, buf.length);
- if (numread==-1) return;
+ if (numread==-1) break;
out.out.write(buf, 0, numread);
}
out.out.write(buf, 0, numread);
}
+ if (close) out.close();
} catch (IOException ioe) { throw new StreamException(ioe); }
}
} catch (IOException ioe) { throw new StreamException(ioe); }
}