// send TRANSFERDESCRIPTION
sendDirect(PacketType.TRANSFERDESCRIPTION, countDescription,
objectid, descData, progress);
if (isRejected(objectid))
throw new RemoteCancellationException();
// send DATA
sendDirect(PacketType.DATA, countData, objectid, data, progress);
BinaryPacket confirmation = null;
try {
while (confirmation == null && isConnected()
&& !progress.isCanceled()) {
confirmation = remoteTransfers.get(objectid).poll(500,
TimeUnit.MILLISECONDS);
}
} catch (InterruptedException e) {
log.error("Code not designed to be interrupted", e);
throw new CausedIOException(
"Binary Channel received unexpected exception while waiting for confirmation package",
e);
}
if (confirmation == null)
throw new IOException(
"Binary Channel was closed while waiting for confirmation package");
if (confirmation.getType() == PacketType.REJECT)
throw new RemoteCancellationException();
assert confirmation.getType() == PacketType.FINISHED;
} catch (LocalCancellationException e) {