in clearcase-common/src/jetbrains/buildServer/vcs/clearcase/Util.java [632:668]
public void run() {
try {
while (position < sourceLength) {
// transfer the current slice
long transferredBytes = 0;
while (transferredBytes < transferVolume) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("position = " + position + ", transferredBytes = " + transferredBytes + ", transferVolume = " + transferVolume);
}
long transferSize = destinationChannel.transferFrom(sourceChannel, position, transferVolume - transferredBytes);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("transferSize = " + transferSize);
}
transferredBytes += transferSize;
}
// wait for all other Transferrers to finish their slice
barrier.await();
}
} catch (IOException ex) {
LOGGER.error("could not transfer data", ex);
} catch (InterruptedException ex) {
LOGGER.error(null, ex);
} catch (BrokenBarrierException ex) {
LOGGER.error(null, ex);
} finally {
try {
sourceChannel.close();
} catch (IOException ex) {
LOGGER.debug("could not close destination channel", ex);
}
try {
destinationChannel.close();
} catch (IOException ex) {
LOGGER.debug("could not close destination channel", ex);
}
}
}