throw new HgInvalidStateException("Bad sink implementation (consumes no bytes) results in endless loop");
}
buf.compact(); // ensure (a) there's space for new (b) data starts at 0
progressSupport.worked(consumed);
}
progressSupport.done(); // XXX shall specify whether #done() is invoked always or only if completed successfully.
} catch (IOException ex) {
recordFailure(ex);
} catch (CancelledException ex) {
recordFailure(ex);
}