while ((numRead = fileInputStream.read(buffer)) > 0
&& streamException == null) {
if (monitor.isCanceled())
throw new SarosCancellationException();
if (Thread.interrupted() || stopped)
throw new RemoteCancellationException();
out.write(buffer, 0, numRead);
sendBytes += numRead;
monitor.worked(numRead);