in src/main/java/org/apache/commons/exec/StreamPumper.java [101:130]
public void run() {
synchronized (this) {
// Just in case this object is reused in the future
finished = false;
}
final byte[] buf = new byte[this.size];
int length;
try {
while ((length = is.read(buf)) > 0) {
os.write(buf, 0, length);
}
} catch (final Exception ignored) {
// nothing to do - happens quite often with watchdog
} finally {
if (closeWhenExhausted) {
try {
os.close();
} catch (final IOException e) {
final String msg = "Got exception while closing exhausted output stream";
DebugUtils.handleException(msg, e);
}
}
synchronized (this) {
finished = true;
notifyAll();
}
}
}