in command.line/java/jetbrains/buildServer/core/runtime/RuntimeUtil.java [110:131]
public static void copy(final InputStream ins, final OutputStream outs) throws IOException {
try {
Thread piper = new Thread(new Runnable() {
public void run() {
int in;
try {
while ((in = ins.read()) > -1) {
outs.write(in);
}
} catch (IOException e) {
throw new RuntimeException(e.getMessage());
}
}
}, "Pipe stream");
piper.start();
piper.join();
} catch (Throwable t) {
final IOException ioe = new IOException(t.getMessage());
ioe.initCause(t);
throw ioe;
}
}